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.

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 ...
1
vote
1answer
57 views

Getting error while adding Test annotation in project using NUnit

I encountered with some errors when tried to add the NUnit Annotation to my code as shown in below image. I have done some error research from Here and here also following instructions from here too ...
-3
votes
1answer
1k views

How to develop data driven framework using Selenium with C#? Please provide example [closed]

How we can develop data driven framework using Selenium with C# to test the web applications? In your response can you please provide an example?
0
votes
1answer
2k views

How to run a NUnit test using cmd

I created a simple test suite using NUnit by opening a new .Net console application project. In the Visual Studio at Test explorer I can see my test methods. Now I want to run them using CMD, i.e. at ...
0
votes
0answers
16 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?
2
votes
3answers
2k views

Selecting element value from drop down list with selenium using POM

I'm trying to make simple test to register in website - https://www.midomi.com/. I'm using c# and selenium but have stuck in selecting values from dropdown list using Page object model. My project ...
-1
votes
0answers
25 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 ...
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 ...
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 ...
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 ...
0
votes
2answers
85 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 <...
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
2answers
294 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 ...
0
votes
1answer
39 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
2answers
6k views

Clicking a cell in a dynamic data table C# WebDriver

The HTML I'm trying working with is below, <div id="enquiry-header-grid-SalesTransactionEnquiry-enquiry-header-grid-wrapper" class="enquiry-kendo-grid-wrapper k-grid k-widget" data-role="grid" ...
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
1answer
386 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
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
67 views

Understanding results of the cloud based load test in VSTS

As part of load testing I ran the set of same API's for several iterations with different user loads. My concern is with the total requests made against the user load. All tests were ran for 10 ...
0
votes
1answer
261 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
2answers
710 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 ...
2
votes
2answers
300 views

Close a one windowHandler at the Webview

I am writing scripts to automate a hybrid application. On my app I have two windowHandles. For example, after performing some actions when I execute below code I get "2" windows as the windowHandles ...
0
votes
1answer
408 views

How to run multiple test cases sequentially in NUnit Console Runner

I'm trying to run nunit3 exe through Jenkins but after building the project, it runs all available test cases parallely. They should run sequetially. I tried where clause in nunit but how it will ...
0
votes
0answers
127 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
2
votes
2answers
314 views

Automation tool for testing integration of a Web application with a desktop application?

I am new to Test automation and would like to try my hand at automating a web application project. This web application gets its data from a desktop application (on syncing). I was thinking that ...
1
vote
1answer
171 views

Finding dropdown name where only the first word matches given string using Selenium

I am trying to match the first word in a drop down list with a given string. What is happening is when I am creating a new drop-down name, it is getting updated by some different name, though the ...
0
votes
1answer
932 views

BDD specflow Error: "Ambiguous Step Definition Found For Step

I am getting this error: "Ambiguous Step Definition Found For Step...." on running my Specflow Test. The code is for the client that I am working for, thus I am not permitted to provide code sample. ...
1
vote
1answer
471 views

Can't open chrome web browser on android

I'm getting the error below when I try to open default chrome web browser on my mobile phone using Appium and c#. It opens chrome for few seconds and it get dispersed, So I can't perform my test ...
0
votes
1answer
73 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 ...
0
votes
1answer
583 views

How to get the Indexes of all columns In a Single Row using Selenium WebDriver and C#?

For single web element in that row i got index..for multiple column in a single row how to get the index: IWebElement colelement = driver.FindElement(By.XPath("//div[@id='grdBooking']//table//tr/ th[...
0
votes
1answer
407 views

Selenium with C# “Element is no longer valid” exception being thrown when repeating steps

I am repeatedly getting a very annoying problem when automating my test cases using Selenium/C# in Visual Studio. This test is designed around validating search criteria text. In order for me to test ...
0
votes
1answer
202 views

Executing appium test on kobiton device

I'm running some of my Appium test cases which are written in c# under .net platform on a real time device which is attached to my workstation. Below is my code and it works fine. public void ...
0
votes
3answers
69 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
48 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 ...
1
vote
1answer
88 views

Coded UI slows down in executing JS enabled fields

Coded UI test cases doesn't respond well on time if they encounter any field having JavaScript validation. Issue: Currently I am facing some issues with the time taken by Coded UI in execution of ...
2
votes
1answer
372 views

Unable to run tests for Appium on Visual Studio 2015 due to Timeout

I am trying to run my script on Appium and I always fail tests because of an error on my unit test: Test Name: Addition Test FullName: AppiumTest2.UnitTest1+BasicScenarios.Addition Test Source: ...
0
votes
2answers
338 views

Device emulator-5554 is not online - while executing my appium code on android emulator

[Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device emulator-5554 is not online Im getting above error when at the middle of the test ...
0
votes
1answer
192 views

Why is there different behavior of a Web Application with Automation and with Manual?

I am automating a website, there's web page containing few text fields, dropdowns. There is a mandatory field check for a dropdown, if I select the default option (which is 'Select') I get an error ...
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
2answers
123 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
122 views

Error - NotImplementedException Was Unhandled

I am trying to subtract the result of 2 variables and I want to echo the result in Selenium. I am using VS2015 as my IDE. //Obtaining pressure For 2100 hours today driver.FindElement(By.XPath(".//*[@...
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
2k views

Selenium Webdirver C# Running more than one test class from the test suite

I have created a test framework in VS 2017. The framework is written in the Page Object Pattern. To avoid having one test class and n number of test methods I have decided to split all my tests into ...
0
votes
1answer
101 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 ...
0
votes
2answers
677 views

how to automate KendoUI dropdown with selenium webdriver and C#

Cannot make it work, need help , I don't know how to automate KendoUI dropdown with Selenium using C#, Sendkeys doesn't work for KendoUI here is my HTML <div style="background-color: #e6e6e6; ...
0
votes
1answer
159 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
228 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
1answer
62 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 ...