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.

Filter by
Sorted by
Tagged with
0
votes
1answer
1k views

Cannot find element with <i> tag in selenium C#

I have an element onscreen that I am attempting to click, my test runner is telling me that SyntaxError: The expression is not a legal expression. I am trying to access an ' i ' tag on a button. ...
0
votes
3answers
5k views

Loading page generates exception 'Timed out waiting for page load'

I'm navigating to a webpage using Firefox driver. The page is loaded correctly but I'm getting this exception and the test crashes Timed out waiting for page load I've tried to add some Thread....
0
votes
1answer
783 views

Generic Automation Framework [closed]

I have to make a generic automation framework which can work on any eCommerce website using Ranorex test automation tool. I am unable to figure out what things should be included in a generic test ...
0
votes
0answers
11 views

Trying to highlight elements on a page one by one using Selenium

I'm trying to highlight all the elements of a page, using Selenium to inject some JavaScript and CSS. However when I run my test i'm only getting back errors complaining that it can't find the ...
0
votes
2answers
45 views

How can I verify that saved data is displayed corrrectly using Selenium + C#?

<p class="details-info-block__text"><span class="details-info-block__label">Business Address 1:</span> 1010 Priority Way West Dr</p> I want to verify the address value (e.g. "...
0
votes
1answer
19 views

Running test suite setup once in every node of Selenium Grid

I am testing an application which would require to configure it into dev mode before test execution. (set the application to point into dev backend instead of live) The configuration itself is ...
0
votes
0answers
28 views

Injecting test data into testcases from async functions through NUnit TestCaseSource attribute

I am creating a test automation framework in C# with NUnit, and I want all my testcases to run with a clean user. Fortunately, developers have already implemented a REST API which accepts POST ...
0
votes
0answers
40 views

Getting Appium integrated with BrowserStack behind a proxy

I'm trying to get Appium WebDriver integrated with BrowserStack, using C# behind a corporate proxy server and am having trouble. I'm using CNTLM due to the proxy server, so am trying to point Appium ...
0
votes
2answers
157 views

Element is not clickable at point (x, y) because another element obscures it - BLOCK UI class

When I run my test, I receive an error because an element obscures the element I want to click. How do I create a wait that will be executed only IF this class is detected, wait it to disappear and ...
0
votes
1answer
24 views

How to insert data into the excel using LINQ in Selenium C#?

For a login check case-> how to insert data into the Excel sheet after each login is checked whether the login credentials are valid or not using LINQ in Selenium C#.
0
votes
2answers
41 views

Convert Selenium Web Element to String C#

Basically, I'm making a programme that logs into the krispy kreme site and to test if login was successful, I am searching for a certain web element. I'm using selenium. For debugging purposes, and ...
0
votes
1answer
71 views

Why doesn't my XPath find my element on the page?

I am trying to retrieve the content of the header and each chapter which is a repetitive structure as you can see below. For this am using Selenium and C#. My attempt, using xpath, is this: string ...
0
votes
0answers
26 views

Firefox opening wrong profile with selenium c#

I'm using selenium 3.14 with geckodriver 0.24, I'm using following code to run the existing profiles I have already created for my different accounts. FirefoxOptions firefoxOptions = new ...
0
votes
3answers
52 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
0answers
475 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 ...
0
votes
1answer
171 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 ...
0
votes
0answers
66 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
1answer
43 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
495 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
159 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
142 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
43 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
2answers
916 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 ...
0
votes
1answer
60 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
3answers
219 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
64 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
217 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
727 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
101 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
310 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
215 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
90 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
536 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
520 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
1k 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
713 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
388 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
8k 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
240 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
210 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
1k 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
128 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
382 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
956 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
73 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
581 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
4k 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
89 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 ...