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
-1
votes
1answer
15 views

How to assert web element is non editable selenium c#

Depending on a condition a input or a div gets render on browser. In my UI automation test I need to assert the div is a non-editable element. I achieved this as- var readOnlyLocation = Driver....
2
votes
2answers
188 views

How to automate Microsoft two-way authentication based login page in Selenium using C#?

In an application user needs to enter email id and password on a Microsoft login page. After clicking on the Log in button, it sends a sms to a mobile number. Now User has to enter the OTP to login in ...
0
votes
1answer
32 views

Testing my own stack class

Im creating a very simple stack class to implement my learnings on TDD. I have created a test that will create a stack and check the length of it. This is my test class: using NUnit.Framework; ...
1
vote
2answers
47 views

Can some one help me to find the CSS selector for highlighted item

Could someone help me to identify the correct csslocator for the second span element in the below image: I tried the below locators but was not able to succeed, is there anything wrong with the ...
-1
votes
0answers
24 views

How to expand the project in visual studio using winapp driver with C#

I am unable to get how to expand the project in visual studio in automation using winapp driver with c#. I am trying to automate Visual Studio using winapp driver. The task I need to do is add an ...
16
votes
6answers
4k views

Writing test automation in Java, while the company domain uses C#/.NET

I´ve recently got a job as a automation tester in a company, that basically only have manual testers (except me). The short term plan is to come up with a good test strategy for identifying which of ...
0
votes
2answers
65 views

Waiting for spinner to disappear does not work

I'm using the code below, waiting for "Loading" spinner to disappear. But I noticed that next test step does not wait until the spinner to disappear. Example: click on button_1 (after click, spinner ...
-2
votes
1answer
20 views

How to provide File and some para. to POST API using Python/ C#?

Team, I am trying to provide File and some para. as a input for API. Expecting output based on validation. Even after providing both inputs correctly, I am getting File as null with length 0. Below ...
0
votes
2answers
29 views

How to validate a successful file download test senario from selenium [duplicate]

I need to automate the following test senario where when I click on a button, a file will be downloaded There will be no message box and no text message. How should I implement this scenario ...
0
votes
3answers
55 views

Can some one please suggest a proper CSS name to find this element

I need to click on the above button just using CSSSelector . I have tried with ; > IWebElement el4m = > Driver.FindElement(By.CssSelector("input[type='button'][contain='Search']")); > ...
0
votes
1answer
55 views

How to generate report using extent reports in Page Object Model in C#

I have created a POM framework using NUnit in C#. I have created Reporting.cs file which creates reports for the test in that class. How I can generate reports for all tests in different classes ...
0
votes
1answer
30 views

How to find path to filtervalue

Can you help me how to find a path to desired "filtervalue", such as value "Search in active documents"? As you can see in the picture, the class filtervalue is there multiple times. Thank you in ...
0
votes
1answer
54 views

Odd behavior noticed during UI tests with Selenium

I want to ask you about the odd behavior I noticed when running multiple tests, using Visual studio, Selenium web-driver and Chrome browser. I have all the tests written as follows: sign in to the ...
2
votes
2answers
93 views

Setup of Test automation framework from scratch using NUnit and Specflow and RestSharp and selenium with Visual Studio 2017 C#

We have so many API's(5 to 8 API calls - Mostly REST based and 1 or 2 in SOAP based) and Oracle DB. We do not have any WEB UI. No UI automation.Only middle tier and backend automation. For automation ...
4
votes
1answer
222 views

Selenium PageFactory vs Page Object Model

I've created a framework in C# using the Page Object Model for fun and am now creating a framework in Java to learn Jenkins etc... also for fun. I have come across the PageFactory concept for Java ...
1
vote
1answer
68 views

Access is Denied Issue thrown at ChromeDriver Initiation step

Azure DevOps is triggering and running tests on a VM. All my tests are working fine on local machine. On VM, While trying to launch Chrome browser using ChromeDriver and WebDriverManager, tests are ...
1
vote
1answer
158 views

Not able to verify the downloaded file with Chrome WebDriver running headless

We are trying to verify the downloaded file in headless mode with C#, the file is downloading but not saving in the download path, so my test script is failing. Any idea for this? The code is below ...
0
votes
1answer
75 views

Unable to connect to Remote Server using Selenium Chrome RemoteWebDriver

public static IWebDriver UserMultiUserSignIn (IWebDriver driver, string port, string hostName, string password, string Username) { string name = Dns.GetHostName(); ChromeOptions Options = new ...
1
vote
0answers
30 views

Android app get forcely closed just after the splash scree - Appium C#

I have create a small test script to open a app and fill some data at the screen. This test works fine with android 5 on Appium server 1.4.16.1 But no I need to run the same test script on a android ...
1
vote
1answer
44 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
54 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
31 views

Selenium chaining IWebElement actions in C# [duplicate]

[FindsBy(How = How.XPath, Using = "//input[@id='Username']")] private IWebElement txtUsername; public void EditTxtUsername(string text) { txtUsername.Clear(); txtUsername.SendKeys(text); } ...
0
votes
1answer
29 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 ...
1
vote
3answers
79 views

How to select option in a dropdown when the html-tag has a random id

I have a problem how to select a desired option (e.g. From, To...etc.) from list if 'datalist id' and 'select name' are randomly generated. This means that the ID and name has another value after ...
1
vote
1answer
29 views

Run Selenium test case in time interval from a console application c#

how to create a console app - a batch file which will hit my Automation testing application and runs selected test cases. I have test case with code coverage and it runs from my visual studio . and ...
0
votes
1answer
65 views

Teardown of Multiple Threaded Tests with Selenium

I'm trying to run multiple test cases with Nunit in C# in which every test needs its own Selenium Chrome Driver. Before it was threaded, I handled the chrome driver with [Setup] and [Teardown] like ...
3
votes
1answer
80 views

Launch web driver without instaling it?

I was trying to launch a PhantomJS browser and it works on Azure VM. (I just point the PhantomJS.exe and it works) Then I try to launch a google web-driver and its asking me to locate the google ...
0
votes
0answers
41 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
1answer
16 views

How to identify java script variable change in selenium C#

As on the below I’m having a HTML page where it change the variable value at the run time. So the java script is to change the isrendered variable to true after 10 seconds. Even after I inspect the ...
0
votes
0answers
60 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 ...
1
vote
3answers
91 views

How to find the Xpath of <Td> tag from text which lie under <a> tag of that <td> in selenium c#

I have to find text on a page, which I did. Now I need to find the xpath of the <td> element containing that text so that I can use the <td> xpath to find other elements like the image ...
0
votes
2answers
59 views

Unable to select <li> element from a <ul> list

How do I select a "li" element from a "ul" tag list? This is my current code vtenants.VT_USDelselectfld.Click(); //Clicks field to display the dropdown Thread.Sleep(500); IList<IWebElement> ...
1
vote
1answer
43 views

Specflow plus evaluation version attaching a screenshot

Is it possible to attach the screenshot in the report with an c#, specflow auto framework. I have included report template in .srprofile As mentioned in https://specflow.org/plus/documentation/...
1
vote
2answers
823 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
3answers
619 views

C# element not interactable

I am unable to click login form element below site: http://www.w-trading.co.kr/member/login.php? I try: driver.FindElement(By.XPath("//*[@id='memberId']")).SendKeys("my_id"); and driver....
0
votes
2answers
42 views

Output Contents of an Element?

I am currently creating a tool. That will login into my Krispy Kreme account and then output my saved address. I am currently at the stage where I have managed to use the tool and : log into the ...
0
votes
4answers
267 views

How to find broken links using Selenium C#? [closed]

Script for testing broken links using Selenium C#.
0
votes
1answer
34 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
54 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 ...
1
vote
1answer
79 views

Closing Driver after all test are runned

I'm using Nunit + .NetCore 2.2 in my project and I need to close the browser only after running all the tests and not after each test class. Currently the tests are closing the browser after each test ...
3
votes
2answers
117 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
35 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 ...
-2
votes
2answers
120 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 ...
0
votes
1answer
192 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?
0
votes
3answers
65 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
55 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
vote
3answers
499 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
653 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
43 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
69 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 ...