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.

3
votes
2answers
6k views

Parallel Execution in Selenium with Visual Studio

How to run test scripts in parallel for Selenium WebDriver with Visual Studio and C# ?
3
votes
1answer
4k views

How to use .xlsx Excel files as Data Source for Coded UI test?

I want to use ".xlsx" format Excel file as Data Source in my hand coding Coded UI test. The best information I get is found in MSDN: Creating a Data-Driven Coded UI Test, which has useful information ...
3
votes
1answer
15k views

How do I extract the inner element in Selenium?

I am new to Selenium and C#, which we are using right now. I am also new to using the Page Object model, to make our codes readable. Though I am having troubles using the FindsBy, so my original code ...
3
votes
1answer
3k views

Coded UI - How write code to use existing browser (if exists) otherwise launch new browser window

I am stuck badly with this piece of code. I am trying to write a code to use existing Browser if it exists otherwise launch my website in new browser window. Currently, if browser is not open with ...
3
votes
1answer
169 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 ...
3
votes
2answers
68 views

Good way to update automation skills with experience in selenium+c#

I want to update my automation skills with experience in selenium+c# working as an Automation QA. I am particularly interested in courses in the London area or online courses I can take to remain up ...
3
votes
1answer
252 views

How does appium work on parallel tests?

I am new to mobile app testing. I am trying to understand how appium works. Basically i need to run tests parallel in both android and ios. But the scripts are written in C#. How would this be ...
3
votes
3answers
18k views

How to find frames without Name and ID using Selenium?

I'm creating some test cases using Selenium WebDriver in C# for a web application. That web application uses different frames for different elements and those frames are not having any Name and ID. ...
3
votes
2answers
1k views

Handle drop down on web page dialog selenium C#

I am working on automation of a website using Selenium and C#, but I am stuck in a situation where on a button click a new webpage dialog opens and on that web page dialog we have to select some value ...
3
votes
1answer
5k views

How to instantiate a .NET FirefoxDriver when FF is installed in non-default location?

My Firefox 5 is installed not at the default location. So, I tried with the following to create a FirefoxDriver: private IWebDriver driver; [SetUp] public void SetupTest() { var ffBinary = new ...
3
votes
0answers
1k views

Get Visual Studio (2013 Community) unit test execution messages

Hi, I'm trying to make "nice" test execution report and get next messages: Message StackTrace Elapsed time Test name and Test Outcome are easily taken as TestContext parameters, for output I'm using ...
3
votes
2answers
318 views

“Element is not currently visible and so may not be interacted with” when locating element by CssSelector/helptext [closed]

I faced an issue with locating the element. Currently it's impossible to locate it by CssSelector/helptext, but it's located by CssSelector/Id without issues Here's the element <span id="...
2
votes
3answers
1k views

How much C# should I learn in order to work with CodedUI?

I will switch to CodedUI from UFT for test automation and don't want to stay with VB any more. I am learning C# from Pluralsight currently and wondering how much and what level I should complete to be ...
2
votes
3answers
275 views

Automation Testing approach for Web Based Application

I am automating a website which has multiple modules and involves users of different privileges (say Admin, User Type 1 and User Type 2). I am using Microsoft's Unit Test Tool inbuilt framework with ...
2
votes
2answers
9k views

How to select an unordered list in Selenium using C#

I had been having a problem trying to select an item in a dropdown. I have checked resources online but I still couldn't get it working. My HTML is this: <div id="dropdownID"> <ul class="...
2
votes
6answers
55k views

Using Selenium (C#) how do I select an item from a drop-down list

I'm using the Selenium IDE to record my initial tests and then export them to c# and then use the webdriver. Some things that I do from the IDE don't export. I am trying to select a State from a ...
2
votes
2answers
9k views

Finding the Parent of an Element, then Clicking a Button Child of that Parent in C#/Selenium

I am quite stuck while testing a web application. I am trying to check to ensure a class exists - in this case the class of "originalProductPrice" - out of a group of identical looking li items. Only ...
2
votes
2answers
6k views

How to set ComboBox value in Coded UI using Value Attribute?

In coded UI is there a way to set the value of a ComboBox using the value of Value Attribute. Consider the following Html of a ComboBox: <select name="ParametersID" tabindex="-1" title="ABC" class=...
2
votes
1answer
9k views

How to change the Text of a IWebElement of Selenium in C#

The Title pretty much explains everything. I'm searching for a way to change let's say <h1 id="title">Title<h1> to <h1 id="title">Nothing<h1> I'm kind of desperate since ...
2
votes
2answers
2k views

Testing pdf/excel content with C#

Our site has a good number of reports that are using SSRS,Crystal and Excel. We are using C# with Selenium WebDriver. I have been searching for the best practices and best ways and tools to test the ...
2
votes
1answer
235 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 ...
2
votes
5answers
7k views

Has any faced issue when automating auto suggest text box using selenium webdriver

I am automating an application which has auto suggest text box. I am facing an issue that sometimes the auto suggest values are not shown up at all. This happens 50% of the time. Worrying part is this ...
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
2
votes
3answers
266 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 ...
2
votes
1answer
176 views

Errors On Launching Browser And Going To Website (In Selenium Webdriver)

@alecxe - I have edited the code. But, I still get errors. Thanks very much for your help. ========================================================================= I have done this several times ...
2
votes
2answers
6k views

(stress) testing tool for ASP.net/C#

I am a Software QA for 3 years, however, I only experienced manual testing which I act the role as end-user in the application (front-end and back-office), I am now hired in other company which I am ...
2
votes
2answers
3k views

StaleElementReferenceException with explicit wait

In my code I used Explicit Waits: private WebDriverWait wait; wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); I tried these methods: wait.Until(ExpectedConditions.ElementExists(By.Id("&...
2
votes
2answers
1k views

How to implement POM for “driver.FindElements”

I was using POM for initializing my elements as below. [FindsBy(How = How.XPath, Using = "//ion-buttons[2]/button")] public IWebElement SearchIcon { get; set; } [FindsBy(How = How....
2
votes
7answers
7k views

Selenium: how to wait for javascript fadeout (visibility and clickable don't work)

So, in the AUT there's a <div> loading screen covering the entire page, which then fades out and gets replaced in the DOM by the <body>. I'm using ExpectedConditions for visibility and ...
2
votes
2answers
682 views

VS 2015: Selenium webdriver reference isn't found

I just started with Selenium and C# and came across this problem at very beginning. I've installed nuget webdriver package in project WebdriverTest, then created Unit test project in which I add ...
2
votes
2answers
83k views

Trying to find span element by class and text with selenium c#

I want to click on Administration panel. The <span> contains a class attribute and inner text. I get an error saying "unable to locate element". What am I doing wrong? HTML: <div class="...
2
votes
3answers
10k views

Efficient way of reading data from Excel in Selenium C#

I am creating some test cases in Selenium WebDriver using C# (I can't use Java as client has said so). These are sample test cases which will be used for presenting a demo to client and senior ...
2
votes
5answers
4k views

Selenium WebDriver not properly waiting

I am trying to download a file from a website using a webdriver. But my browser is shutting down before it was able to properly export. I inserted a wait() before I call dispose() but it is not ...
2
votes
2answers
11k views

Question: C# Selenium: Read rows from html table until the last row is found, and Store in array

The following snapshot is what I see when I do a view of class and Ids in using IE Developer tool. It consists of a table and inside the table there are links. I need to read all the link names, and ...
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="...
2
votes
1answer
289 views

List<IWebElement> not being populated from a local variable causing NullReferenceException

I'm experiencing a few issues with trying to create a list using List<IWebElement>from a local variable. The HTML I'm working with is below, <div id="enquiry-header-grid-...
2
votes
2answers
7k views

WebDriverWait ExpectedConditions stopped working after updating Selenium.Support NuGet

Before updating Selenium.Support Nuget, all test cases in my test suite were running correctly. When I updated the Nuget yesterday, all my test cases in which I use WebDriverWait ExpectedConditions, ...
2
votes
2answers
3k views

Selenium Webdriver - Locating element inside form

I am trying to write a webdriver C# code that checks for elements in a site. However, the site is a single page website with an embedded form. The form contents changes when you click Next. So I am ...
2
votes
1answer
649 views

What tools are available to test console applications (I/O) on Windows?

We have several exes that interact with one another and would like to use something akin to "Selenium for Console Apps". What's available in C# land?
2
votes
2answers
3k views

Error: System.NullReferenceException error in Selenium with NUnit

I'm getting following error at verification stage: "An unhandled exception of type 'System.NullReferenceException' occurred in nunit.framework.dll Additional information: Object reference not set to ...
2
votes
1answer
926 views

How to get a list of similar elements using Ranorex?

A newbie Ranorex, I come from a Selenium Python background. I can not figure out how to find an array of similar elements in Ranorex. With Selenium, we can use something like: array = webdriver....
2
votes
1answer
1k views

Improving my Unit testing: How to test simple methods that call internal methods, resulting in complex (yet similar) output

I've got data access layer that has two types of method GetLatestX and GetX. GetLatestX looks something like this: public IElementType GetLatestElementType(Guid id) { IElementType ...
2
votes
1answer
2k views

MSTest-Cross browser testing C# with Selenium?-how to run C# Selenium tests against multiple browsers

At the moment my tests are running only in Firefox, because that is the driver which initialize at last. I need to run my tests on both Firefox and Chrome. Parallel or serially. But it should be ...
2
votes
1answer
4k views

How to run same test case for four differant environments in selenium

On my project i have 4 different environment. Dev,stag,uat and prod. So i need to run a test case for all four environments as a one test case. Only the change to the code will be web driver URL. So ...
2
votes
1answer
2k views

How to run a selenium project on a different server without visual studio

I have create a selenium test suit on my pc with visual studio. I can run it by right clicking on test explorer. Now i need to run the same project on a different pc where it don't have visual studio,...
2
votes
1answer
568 views

Selenium Grid sending commands to the wrong node

I am working on setting up a distributed testing environment and am running in to an interesting issue. When running tests in parallel the tests seem to get routed to the correct nodes and execute to ...
2
votes
2answers
16k views

How to get C# to initialize geckodriver

I cannot find any implementations to get geckodriver to run my tests on FF for my C# solution, so I am reaching out to see what solutions you guys might have. I have tried these two: ...
2
votes
1answer
326 views

C# + Visual Studio : Can I create multiple selenium test through unit test project type in one solution?

This is a newbie question as I am very new to selenium and automation basics. I am creating my selenium tests through Visual Studio, with the help of C#. I have some confusion on these areas: I am ...
2
votes
1answer
536 views

Coded UI Test Explorer execution order?

What is the order of test cases execution in Coded UI? I have my test cases created in Coded UI and they all follow a naming convention e.g. _, so my test cases name looks like: ...
2
votes
3answers
176 views

Personal framework project website [duplicate]

I am a selenium C# developer, and have just recently conducted an interview with a company. During this process I was asked a lot of questions about "hypothetical" framework questions, and how I would ...