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.

0
votes
0answers
15 views

How to select a TreeView node in WinAppDriver

So I am trying to select a node on a TreeView using WinAppDriver, any thoughts on how to find a element that will have a value I can access the element with?
-1
votes
0answers
22 views

Is it possible to convert trx file to html files inside the azure build pipeline and email it to some one

I have set up a unit test project on azure build pipeline. After the test execution it will generate a trx file. I need to convert that to a nice HTML file using "TrxerConsole.exe" and then need to ...
-5
votes
1answer
25 views

Unable to identify element when span class is closed and text is displayed in it [closed]

No these are not working for me.. could you please suggest the css selector for the following DEMO SITES
0
votes
2answers
32 views

Trouble deleting NaN in input field

I'm using Selenium to fill in a web form. The fields there have their default values, usually it's 0. If I issue the command Driver.chrome.FindElement(By.Id("ID_of_my_element")).Clear(); the value ...
0
votes
1answer
43 views

How to click a expand button if ID is randomly generated

I have a problem how to click a desired expand button if ID is randomly generated. This means that the ID has another value after refresh page. Of course, the ID has another value for each row. I don'...
-1
votes
0answers
18 views

How to get AWS authantication token for a unit test

I have some APIs to be test. All the APIs need authantication token need to be pass with the request header. Im using c# to test the above APIs. So, Is there any way to get the AWS user ...
1
vote
3answers
463 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 ...
0
votes
0answers
117 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
38 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
53 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
37 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
31 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
59 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
40 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
74 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
74 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 ...
2
votes
0answers
57 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
42 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
221 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
71 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
81 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
29 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
928 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
31 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
91 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
230 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
1k 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
627 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
253 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
58 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
281 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
68 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
303 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
40 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
329 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
601 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
91 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
394 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
121 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
186 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
168 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
157 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
100 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 ...