Stack Exchange Network

Stack Exchange network consists of 175 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#]

Use for questions about testing using C#. This can include unit tests, integration tests, UI tests. If a programmed test uses C#, and the question relates to testing rather than to code, the C# tag should be used.

1
vote
3answers
454 views

Unit Test - Testing API Methods

I was reading the following article Unit testing an API This article is about unit testing an API and the methods on a class through the interface. What I do not seem to grasp is the fact that in my ...
-2
votes
0answers
26 views

Performance Testing Tool for Webservice(API) and Web Application using C# [on hold]

Can anyone suggest me which performance testing tool can be used for both Webservice(API) and Web Application using C#?
0
votes
0answers
51 views

Selenium Error - The HTTP request to the remote WebDriver timed out after 60 seconds after clicking install button

while creating my test using c# and selenium i ran into a issue i haven't had before. the test basically opens the web site, logs in as admin, and within the admin page i than have to install a plugin ...
2
votes
1answer
36 views

Strange exception when executing tests

I write test automation using Selenium and C#. I use the Page Object Model consistently. And have had a random bug crop up in my code: Type of member 'IWebDriver' is not IWebElement or IList
1
vote
2answers
37 views

In a Webdriver UI test, do you have to check for the existence of every element you use?

I'm working on my first Selenium/Webdriver tests, and I have a rather basic question. I was thinking of adding a login helper method, since it's going to be a rather basic feature of every test. I ...
0
votes
1answer
34 views

How can I turn a list of assertions into a table? C#/Specflow Selenium

I am very new to using C#/Specflow to write tests so thank you for the patience. I have a test that ends like this: Then the Details page should display the rating zip code And the Details page ...
0
votes
1answer
29 views

Locating a web element

I am having a bit of trouble locating a particular button in one of the ecommerce applications I am writing automation for. Here is a snippet of the mark-up: <button class="btn btn-primary btn-sm"...
0
votes
1answer
44 views

How can I use Sequential attribute with TestCaseSource in nUnit?

I'm new to unit testing and nUnit in general and I'm not sure what I'm trying to do is possible or if I'm using the right syntax (in C#). I want to pass for a test a collection of IEnumerable using ...
6
votes
3answers
1k views

Is there any way to click on 6th item of this list

As on the image I have to click on the 6th item on the list. I can easily do this with IList<IWebElement> But is there any way to do the same thing with the help of 2005256 digit which is ...
0
votes
0answers
35 views

Integrating VS 2017 C# Selenium Test Cases into TFS

Ok I am new to TFS only just got access to it in my company. I have been writing UI functional website test cases in VS 2017 using selenium and c#. I now wish to integrate these into TFS. From a ...
0
votes
3answers
71 views

How to click a checkbox if only value is different for each row

I have a problem how to click a desired checkbox if only value is different for each row. Here is a code for a first row with 'Access all mailbox': Thanks in advance for your help.
1
vote
1answer
64 views

TFS Selenium C# Visual Studio 2017

I have recently joined a company and they use TFS. I am an automated tester so I have setup MS Unit framework, selenium and c# within VS2017. I am comfortable in doing this standalone because its ...
1
vote
0answers
38 views

Retry in nunit not working when test times out

I am using Timeout attribute for nunit test case as below: [Test, TestCaseSource("TestCases"), Retry(2), Timeout(10000) public void test(){ // Some code that runs for more than 10 seconds } I ...
0
votes
1answer
40 views

How to print out a list of students (from this dictionary) with a score above 40? [closed]

How can I print out a list of students (from this dictionary) with a score above 40, please: I would like to use an "If", else statement. But, I need help with how to get the computer to pick the 2nd ...
0
votes
1answer
142 views

The name PageFactory does not exist in current context

I am using a POM in C# with Xunit as a framework, and am getting error in pagefactory for the following code: PageFactory.InitElements(driver, login); Error: "The name PageFactory does not exist ...
0
votes
0answers
58 views

Selenium C# Tests on Various Browsers

I would like to run my tests on multiple browsers but NOT in parallel. I want to provide a pop up to the user to choose which browser (IE, Chrome, Firefox) to execute all tests on when first started. ...
0
votes
0answers
70 views

Writing selenium tests againgst bootstrap Checkboxes

I have currently a big Problem to click on a Checkbox in a bootstrap designed GUI. In Html it appres like this: Does someone know how to press the Button of this checkbox? Because the controls are ...
0
votes
0answers
28 views

Why does my appium server skip my second emulator on parallel test

I have done the following: Start Selenium Grid Started 2 emulator; Started appium servers for both using appium -p --nodeconfig /absolute/path/.json Ran my script: DesiredCapabilities cap = new ...
0
votes
1answer
589 views

PageFactory is deprecated in C# (.NET) - what to use instead of that

I was using for a long time PageFactory (in Java). Now writing tests in .NET I found out it's deprecated. Right now I just initialize all page objects when application starts using [BeforeScenario] ...
-1
votes
1answer
30 views

(C#) Selenium - How to validate if a tr exists in an HTML page

I need to check in an HTML page if the "tr" exists, if the td does not exist that it condonue to execute the code and does not present an error for not having found, as it presents in the following ...
1
vote
2answers
55 views

Can not find getPageSource method in visual studio 2017

I am using Visual Studio 2017 and found that class ChromeDriver does not contains method getPageSource(). Does anybody knows why? using System; using System.IO; using OpenQA.Selenium.Chrome; ...
1
vote
1answer
54 views

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

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
155 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> ...
4
votes
2answers
872 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
417 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
172 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
56 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
56 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
2answers
210 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
65 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
181 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
35 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
237 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
53 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
353 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
86 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
323 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
34 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
109 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
51 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
160 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
153 views

Unable to locate the element using Xpath selenium C#

How can I get the highlighted value using Selenium C#?
0
votes
1answer
45 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
151 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
97 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
451 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
272 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
47 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
2answers
77 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
107 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> ...