Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c#]

C# is a multi-paradigm programming language developed by Microsoft.

0
votes
1answer
34 views

(C#) Error in Loop for with If in a string search [on hold]

Even finding the desired value in the register vector displays the message "TP não encontrado". I need that when the value is found it does not display the message that was not found. for (int i = 0;...
1
vote
1answer
27 views

How to find IWebElement in other IWebElement with Selenium Web?

I'm trying to get some IWebElement in other specific IWebElement which I find, but it doesn't work. Here I find all of the repeated HTML blocks, it works OK: List<IWebElement> ...
-1
votes
0answers
39 views

(C#) How to do a binary string search? [closed]

I need help to do a binary search using string, I'm a beginner and I'm having this difficulty. The compiler says that it is not possible to convert from string to int. I also do not know how to call ...
-1
votes
0answers
16 views

How to create mousemove in my flat C # form? [closed]

I'm creating a flat-style form, but when it executes I can not move it with the mouse
-1
votes
1answer
43 views

(c#)How to make a button run automatically every 8 seconds? [closed]

I need this button to run automatic private void button2_Click(object sender, EventArgs e) { if (File.Exists("c:\\form\\registro " + DateTime.Now.ToString("dd" + "-" + "MM" + "-" + "yyyy") + "....
-1
votes
0answers
34 views

How to extract a certain rows from a txt? [closed]

I need to extract a particular part of a Txt from the fetch of a value. Example: When I search for "147" the program locates in my Txt. My Txt From this search I want to save the above data until ...
3
votes
2answers
526 views

How to select the second tr of my HTML?

The code below works but it only selects the first tr: My HTML: <script>if(''!='') { document.Form2.endereco_ip.value='';}</script> <div style="font-size: 10pt; font-weight: bold">...
-1
votes
1answer
42 views

(C#) Selenium: How to convert an IWebElement to String?

Error CS0029 Can not implicitly convert type OpenQA.Selenium.IWebElement em string What I am doing is: // Declaration of the global variable portalweb public string portalweb; // function to click ...
2
votes
3answers
78 views

(C#) Selenium: How to extract information from html and write to a variable

I want to know how to get the HTML tag information and write to a C# project variable. Remember that I can not change the HTML because I do not have access. In the example below, it is necessary to ...
1
vote
1answer
40 views

(C#) Selenium: How do I choose an option within a ComboBox?

How do I select the "C" option of my ComboBox "opcao_pesquisa"? <form name="Form1" method="post"> <input type="hidden" name="operacao" value="1"> <input type="hidden" name="d" ...
2
votes
2answers
52 views

Selenium: How do I use the button of my HTML in WebElement?

How do I locate my button that has the text Pesquisar > in my Selenium WebElement? My HTML: <div style="font-size: 10pt; font-weight: bold">Portais </div> <hr> <form name="...
0
votes
1answer
38 views

Getting row count of HTML table always returns 1?

I wish to grab an HTML table and extract the number of rows it has. I stumbled upon a solution linked here link. However, the proposed solution always returns row count of 1. I've alswo tried the ...
2
votes
1answer
48 views

Select elements within <div> and <iframe>

We started test automation on our web app (ASP.NET). We should've done it ages ago and the meantime the app has become complex so our Selenium progress is very slow. I'm completely new to Selenium and ...
0
votes
2answers
60 views

Selenium Element is not clickable at point, button behind other element

I have a site we are testing, but for some reason the screen wraps and puts the 'search' buttons on the right, behind the fields. Like it is wrapping, and instead of being on the button below, it goes ...
1
vote
1answer
18 views

How to update C# version in Ranorex Studio?

My project in Ranorex Studio (v8.3.1) is using .NET Framework 4.5.2 and C# 5.0. I want to leverage the features of newer C# versions e.g. String Interpolation. So I want to upgrade my Ranorex Project ...
1
vote
1answer
52 views

Unable to select element when element is in span than select Selenium c#

I am trying to select an element from dropdown with text as Ad. My page has a telerik dropdown and this is the HTML Code. I am running following code: SelectElement IDdropdown = new SelectElement(...
0
votes
1answer
43 views

(Selenium) Trying to locate Button with Span

I am trying to locate a Button with a span text. I already tried it with the class but the class is used 6 times. HTML: <a href="#" class="btn-orange btn-border" ng-click="selectWorld(w.id)"> &...
0
votes
1answer
42 views

Selenium go to scrolled element! [duplicate]

I have an element but ı need to go there with scroll how can ı do ıt wıthout scrolling how can ı clıck it?
1
vote
2answers
75 views

Selenium Webdriver - handling error messages that are shown to user

I've made an automated test case that creates a user inside an app. It's pretty simple, the test enter username, email, password and presses OK. But how should I handle scenarios if user enters an ...
0
votes
2answers
68 views

Compare a screenshot with saved image on Devops build server

Background When releasing a C# MVC website through Devops release management the bundling failed. This caused the CSS file not to load on the released website, causing the UI to render incorrectly. ...
0
votes
2answers
27 views

Sequential Webdriver Testing with Selenium C# Testing

I would like to create a set(more than two) of Selenium C# [TestClass] which are structured in a way that would run on a single WebDriver object. Is it possible to possible to have an object lifetime ...
0
votes
2answers
37 views

Sharing static class variables data between two Selenium classes c#

I have two Selenium C# test case classes, ClassA and ClassB. I would like to reuse a static variable VarA, defined in another static non-test ClassC. After ClassA has made a change to the variable, I ...
0
votes
1answer
41 views

Unable to locate a search suggestion element Selenium C#

Hi, I am trying to locate and click on the element that comes up in the search box when I type some name. Can someone please help me out to find & click on the name? I've use searching by XPath - ...
1
vote
1answer
71 views

Deviation in JMeter

I am new to Web API development. I have created a small Web API, which returns a JSON output. The Web API is running on another PC in the same network. I have been connected to the API via GET ...
1
vote
4answers
77 views

Unable to locate the element using Xpath selenium C#

How can I get the highlighted value using Selenium C#?
0
votes
1answer
41 views

Before entering entire text completely, Selenium is saving data

There is a form having only two field name and Code. Code validation criteria is minimum 2 and max six character. As soon as you enter 2 character save button become enable. Now, problem is when ...
0
votes
1answer
82 views

Selenium, data driven testing using NUnit and SQL queries.

I am developing a Selenium Test Automation Framework for the purpose of testing multiple websites. I have currently set up the Framework in Visual Studio using C# and implementing the Page Object ...
0
votes
1answer
43 views

How to validate a particular row among many rows?

How to validate a particular row data among many rows in the table for testing in c# and once if all the data are verified than test case is passed and if not verified then fail? using System; using ...
1
vote
1answer
76 views

How to compare string value with integer in Selenium [closed]

I'm getting the text as string and i need to compare it with a number, If its grater than that number then execute an if statement and if not then else. I'm using following code : string sato = ...
0
votes
1answer
64 views

Selenium OnClick identify button C#

How to identify this button in C#: <button class="reward_link_redeem_button_style" onclick="RedeemRPProduct('free_points_1')">REDEEM</button> <button class="...
0
votes
1answer
39 views

How do I pass payload to API test?

I'm creating an API testing framework, and to avoid having a test class containing 1000's of lines of code I'm looking at creating separate classes which will hold the xml data, which I'll then call ...
0
votes
1answer
63 views

Setting up an API Test Framework

I'm testing an API and I'm looking to define my payload using classes so that my program can then deserialize/serialize into any format(namely XML in my case). Below is an example of the payload <...
0
votes
1answer
54 views

XML Payload gives 'The ' ' character, hexadecimal value 0x20, cannot be included in a name.' error

I'm attempting to create a test framework in c# to automate some of our API tests. Relatively new to this area so have come across an issue I can't solve. My XML payload is as below: <Order> ...
3
votes
1answer
88 views

Headless browser testing

I have a question around headless browser testing which I am looking to utilise in my automation framework, which is written in c#. Headless browser testing is not an area I'm familiar with but I'm ...
2
votes
1answer
66 views

Passing parameters between tests with RestSharp

As I'm getting more familiar with the RestSharp client library for my API testing I'm confortable with using it for single API response checks e.g. checking a status code is correct, or that the ...
0
votes
3answers
58 views

Testing multiple API contracts as part of 1 test

I have a situation whereby, say, I have one API which creates an employee(POST); one which then returns the employee(GET) and one which deletes the employee(DELETE). I've been using RestSharp/C# to ...
1
vote
1answer
38 views

How to test API contracts when there is a dependency on data from an outside source

I'm after some advice regarding a project I am currently working on. There is a front-end, similar to what Amazon is like in that sales are fed through the site(there is no API for doing this). ...
0
votes
1answer
41 views

How to navigate to a “Not Secured” web page using PhantomJS

I was trying to navigate to a web page which is not secured. When I try to do this using PhantomJS, it's not navigating the web page. I can see that by debugging the code. So, how should I navigate ...
5
votes
5answers
109 views

Useful real-world APIs to test against

In order for me to firm up my understanding of API testing I'm looking at testing against some real-world API's. For understanding, I'm going to be writing my API tests in C#, ideally utilising ...
1
vote
1answer
161 views

Configuring OAuth2 with RestSharp

I'm looking to set up a test against the Vimeo API and have been using some of the RestSharp tests to set me up. However, since these test were written Vimeo now requirs OAuth2 rather than OAuth1. I'...
1
vote
1answer
102 views

Run Selenium Automation on Microsoft Tablet chrome browser (real device)

As a part of the Automation Test, I have to set up my test framework to run tests on Microsoft Tablet(real device), I am not sure how to connect my framework with the tablet device. please suggest ...
1
vote
2answers
45 views

Advice on assertions to make when creating an API testing framework

I'm currently looking at building an API test automation framework for a series of Rest Services, utilising c#. Coming from a UI-automation background I was after some advise on assertions when ...
2
votes
1answer
90 views

What are the pro's and con's of writing an API test automation framework at code level as opposed to using a tool

As I look into writing automation frameworks at the API layer(relatively new to this area), a question that keeps cropping up in my mind is.....why should I write an automation framework at code level ...
0
votes
2answers
336 views

Deserializing JSON response using RestSharp

I'm looking for some general advice with an API framework I am setting up using C# and RestSharp as the client library. I've successfully set up an initial test, but I'm now looking at creating a ...
0
votes
1answer
124 views

C# Selenium - How to write a conditional statement with multiple elements/xpaths

I have a problem and having trouble to finding a solution. Problem Statement: Navigate to a webpage and check if three checkboxes are selected. If not, I'd like to select them (if only one is ...
0
votes
1answer
203 views

How to use the page object model pattern in C# without deprecated libraries

What can I use as an alternative option to the soon-to-be deprecated OpenQA.Selenium.Support.PageObjects library? I still want to make sure I encapsulate the elements and be able to assemble the ...
0
votes
1answer
165 views

Clicking flipping image in selenium webdriver using C#

New to this platform I'm a beginner learning selenium webdriver with c# but I have a problem clicking on a flipping image, I identify the id but it won't click on it. I was told to use wait which ...
0
votes
1answer
63 views

Specflow tutorials which cover UI testing

When initially delving into the realm of BDD my initial foray was with Java and Cucumber. I found a wealth of knowledge online which allowed me to get to grips with this, specifically real-world ...
0
votes
1answer
45 views

How can I solve OutOfRangeException on using Selenium C#

I was faced with the below problem while trying to run a data driving testing and have tried to resolve it but nothing seem to be working for me. Please could you take a look at my code and tell me ...
2
votes
4answers
2k views

API Testing tools in C#

I'm looking at writing at automated tests to cover regression testing in respect of Restful API's. I have familiarity with how to do this in Java using Rest Assured, however the company I currently ...