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
2answers
126 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 - ...
0
votes
1answer
160 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
394 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
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 <...
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
1answer
168 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
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
411 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
1answer
410 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
763 views

How can i get the value from a dropdown of div class in selenium webdriver?

How can i select a value from the dropdown using selenium web driver
0
votes
1answer
587 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
2answers
678 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
2answers
258 views

Testcase fails when running as a Jenkins project

I have a simple test case where it asserts the Width and Height of an element. Assert.AreEqual(Height, 170, 100); Assert.AreEqual(Width, 636, 100); The test case passes when it runs using VS test ...
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" ...
0
votes
1answer
3k views

c# webdriver - Trying to validate the data in all cells in a certain row in a dynamic data table

I'm new to the site and to WebDriver. I am trying to work with a dynamic data table - HTML below <div id="enquiry-header-grid-SalesTransactionEnquiry-enquiry-header-grid-wrapper" class="enquiry-...
0
votes
1answer
206 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
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
935 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. ...
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
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
3answers
855 views

selenium can't find class

I'm using selenium and can't find this class var element = driver.FindElement(By.XPath("//*[contains(@class, 'rc-imageselect-table-33')]")).Text; //works from this link https://patrickhlauke.github....
0
votes
0answers
70 views

Dropdown is not consistent in Selenium Webdriver 3

I just updated my webdriver from NUGet this morning and I am having issues with the dropdown. Below is my code: public static void SelectDDL(this IWebElement element, string value) { element....
0
votes
1answer
507 views

webdriver doesnt Click (sometimes) even after waiting for ElementToBeClickable

Example not exact code: WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(45)); wait.Until(ExpectedConditions.ElementIsVisible(By.Id(Element))); wait.Until(ExpectedConditions....
0
votes
1answer
3k views

Logging in Selenium Webdriver using Log4net [duplicate]

I am using log4net for creating execution logs of test cases which are created and being executed using Selenium Webdriver in C#. I was able to implement the logging functionality but I am facing an ...
0
votes
1answer
1k views

How to access a dynamically created element

I am using Watin to test a website. It contains a div which is created dynamically on clicking a tablecell. How can I access the dynamically created div. The issue is the div is deleted after a short ...
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
votes
1answer
671 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 ...
-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
votes
1answer
136 views

Test case for a set of questions [closed]

I have this scenario where my page has set of questions and the answers are in radio buttons Yes and No. There are around 7-8 yes/no questions. I want to design a test case using C# so that everytime ...
-1
votes
1answer
37 views

Website login Issue in selenium Chromedriver

I am login to a website using selenium and chromedriver. But website login details are shown as incorrect every time. But I have manually logged into the site using chrome browser easily How do I ...
-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 ...
-1
votes
0answers
20 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
votes
1answer
133 views

Selenium: any more ideas what to do when everything fails but Sleep?

So... I have no idea why (well, probably Javascript) but here are the different issues with the code below. With a visibility/enabled wait, Selenium executes the Click() but it doesn't do anything on ...
-2
votes
1answer
82 views

Find out if nested class is zero [closed]

I have a class "Data" and a subclass "SubData". I want to access a method in SubData. In order to do something like: value = Data.SubData.getValue(); I need to make sure that Data!=null and also ...
-2
votes
1answer
75 views

Creating A Folder In Visual Studio 2015 Adds It As A Sub-Folder Of An Existing Folder [closed]

New folder is not displayed as a separate folder. Instead, it is created as a sub folder of an existing one Please, has anyone encountered this problem ? In M/S Visual Studio, a new folder is created ...
-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?