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
vote
2answers
661 views

Why is explicit waits flaky?

I have my code below: IWebElement elem = null; WebDriverWait wait = new WebDriverWait(DriverContext.Driver, TimeSpan.FromSeconds(20)); elem = wait.Until(ExpectedConditions....
1
vote
1answer
78 views

Testing Different User Setting's Effects On a Page

I am using Microsoft Visual Studio and Selenium to test a webpage. This particular website requires a user to login to the web page and based on some settings, some elements will be displayed and some ...
1
vote
1answer
1k views

How to count rows in GridView using webdriver c#, how to translate the existing protractor script to c# webdriver

I am trying to count the rows of the table and below is the HTML: I want to get the total count rows of the table, discarding table header and expanded row. I had tried the code below: var ...
1
vote
2answers
104 views

Software to Build a Selenium POM

I have a basic script that parses through HTML and creates a basic POM based on Inputs, Selects etc. It does a decent job but I was curious if there is any 'professional' or popularly used pieces that ...
1
vote
1answer
109 views

Selenium: source code for the different locator types?

So, I've been wanting to take a look at the dotNet code for the different locator strategies (Id, ClassName, XPath, TagName, ...). In the By class, I've found this for Id: by.findElementMethod = (...
1
vote
2answers
8k views

How to verify PDFs with Selenium web driver

In our application, we upload PDF's into an interface. In this interface, the PDF is just a property of an object in a row that is displayed for the end user. The end user can see if a PDF has been ...
1
vote
1answer
1k views

How to read value from XML [closed]

I know this is a common question, but I have a requirement where I need to read values from XML file. Sturcture of the XML file is <?xml version="1.0" encoding="utf-8" ?> <root> <...
1
vote
3answers
49k views

Selenium: Select 2nd item by both class and with certain text?

I am creating some test scripts using Selenium WebDriver in C#. The AUT contains a left menu in which the position/ordering of the links depend upon the 'User Preferences' and a lot of factors/...
1
vote
2answers
16k views

Cannot access elements in iframe

I cannot access elements inside of an iframe, I have tried the call: IWebElement iframeSwitch = driver.FindElement(By.XPath("//iframe[contains(@id, 'contentIFrame1')and contains (@title, 'Content ...
1
vote
2answers
5k views

Can I use Eclipse for .Net application with Selenium jars?

My application is developed using .Net and now I need to automate this application using Selenium. So, please guide me which Selenium jar and IDE I have to use to do automation. I know, for Java ...
1
vote
1answer
9k views

Selenium framework using C# and excel

I am new to automation (Selenium ). I am working as manual tester and recently got a task related to selenium automation. I have basic knowledge of selenium and very good knowledge of C#. I can ...
1
vote
1answer
2k views

Wrap specflow scenario within try-catch

I have been running into a problem with the C# selenium bindings decribed here: https://stackoverflow.com/questions/22322596/ where a timeout exception is thrown occasionally while running my ...
1
vote
3answers
5k views

Disable a pop up rendered in FF and not with IE

when testing with Selenium Webdriver, I'm getting an advertising pop up window with Firefox and not with IE. Actually this pop up is preventing me from doing many other tasks. Is there a way to ...
1
vote
3answers
5k views

Automated Test With Image Comparison

I have a WPF application and I have a custom object (the output) with images and text. I need to check if the output has a correct format. I tried with Coded UI but, because the element is a custom ...
1
vote
1answer
750 views

How to save compiled document on Desktop using C# Selenium

Using Selenium WebDriver with C# in VS 2010, I compiled a document using automation and then I want to save the file on my desktop. During automation a new window is popping up to "save or open file". ...
1
vote
1answer
24 views

NUnit Assert.This(obj, method) for C# - where to find list of evaluation methods?

I'm an old embedded coder, new to NUnit and VS C#. I'm trying to get used to the Assert.That(obj,[EvaluationMethod]) methodology that NUnit 3.x is promoting. I'm slowly getting up to speed, but was ...
1
vote
2answers
56 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
vote
3answers
298 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 ...
1
vote
2answers
4k 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 ...
1
vote
1answer
116 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 ...
1
vote
2answers
71 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 ...
1
vote
3answers
357 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 ...
1
vote
1answer
133 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
366 views

Deviation in JMeter

I am new to Web API development. I have created a small Web API, which returns a JSON output. The Web API is running on another PC in the same network. I have been connected to the API via GET ...
1
vote
1answer
1k views

How to compare string value with integer in Selenium [closed]

I'm getting the text as string and i need to compare it with a number, If its grater than that number then execute an if statement and if not then else. I'm using following code : string sato = ...
1
vote
1answer
44 views

How to test API contracts when there is a dependency on data from an outside source

I'm after some advice regarding a project I am currently working on. There is a front-end, similar to what Amazon is like in that sales are fed through the site(there is no API for doing this). ...
1
vote
1answer
91 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
784 views

How to use the page object model pattern in C# without deprecated libraries

What can I use as an alternative option to the soon-to-be deprecated OpenQA.Selenium.Support.PageObjects library? I still want to make sure I encapsulate the elements and be able to assemble the ...
1
vote
1answer
1k views

Dll file is missing in my Debug folder (C#-Selenium)

I am trying to run my Automated test cases from the command line. My tests were written in C# - NUnit-Selenium-Webdriver. I opened my solution in file explorer then navigated to Bin--> Debug, but I ...
1
vote
1answer
2k views

How to fail NUnit test by default (I want to call Assert.Pass when it should pass)

I have medium level experience on unit testing and now I'm learning about NUnit. As far as I can see, a NUnit test passes by default if you don't call Assert.Fail method. In my test case, I want it ...
1
vote
1answer
5k views

What is the simplest way to rewrite Postman requests to C#

I have made lots of made Requests in JSON in Postman. Now I am thinking about re-write all the Postman-tests into C#. There are many different Nuget packages that could be used. I have googled a ...
1
vote
1answer
633 views

Adding DateTime.Now; to a URL for a test in Selenium-Webdriver and C#

I am trying to navigate to a specific URL as the Given statement for an automated test case and use a DateTime.Now structure to insert a required date into the URL for the browser to navigate to, ...
1
vote
2answers
7k views

Selenium iterating through list C#

I need to create a simple loop that iterates through a list of options in a list container and searches for a specific option. When the text is found it should scroll down to that option so it's ...
1
vote
1answer
68 views

Organizing NameMapping for a ton of objects

I would like to hear your opinion on how I am organizing our large amount of Elements found in our web application. Currently we are using selenium to run functional test cases. Our test cases reach ...
1
vote
1answer
5k views

Error - An unhandled exception of type 'OpenQA.Selenium.NoSuchElementException' occurred in WebDriver.dll: Unable to locate element

I am trying to click on a tab - a rather simple task.But, I get the error message above. I have added a thread.sleep command - in case it is due to synchronization issues. Your help is highly ...
1
vote
3answers
1k views

Microsoft Dynamics 365 Sign In button can't be clicked by Selenium until mouse move action is performed

I'm trying to create a login test for Microsoft Dynamic 365. I am able to fill in the login form fields, but the Sign in button is disabled until the user moves the mouse cursor https://www....
1
vote
2answers
205 views

Count dropdown menu items

In my case, I choose a file and I open the drop-down menu. In the drop-down menu are three actions: Add tag Remove tag Lock document I use "Lock document" action and after that if I choose the same ...
1
vote
1answer
567 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 ...
1
vote
2answers
4k views

How to click on elements which “Displayed = False”

I was trying to click on a element by finding it using classname But i got an error saying element is not visible. Then i debug the code and saw "Displayed = False" . But the element is fully ...
1
vote
2answers
741 views

How best to validate functionality using the console log?

Please focus on the area highlighted in red. As shown, when I try to do a search by typing "7396198", the "Loading content. Please wait" never disappears, so search is not working. I can do an ...
1
vote
1answer
625 views

Selenium IwebDriver pasing thru a method

Below is my code , and it works fine public static void WaitTillthisclassName(string elemantName, int TimefromMSeconds) { WebDriverWait wait = new WebDriverWait(Driver, TimeSpan....
1
vote
1answer
146 views

Selenium test reporting, my way [closed]

Below is a sample test case which I wrote on my test suite. In my project i need to be more focus on test reporting, so I thought in storing the test Pass / Failed status on SQL data table. Then I ...
1
vote
1answer
1k views

Specflow Page Object Model Maintainability

I was wondering if anyone could assist in a Code Review on my Specflow Page Object Model code. I have included a small sample of the code I use, most of the pages follow identical patterns. Step ...
1
vote
2answers
10k views

Selenium Driver Service Not Found Exception

Good Afternoon All, I am creating a testing framework for a web app utilizing Selenium Web Driver and Visual Studio by way of C#. I have created a solution that includes two projects. The first ...
1
vote
1answer
810 views

Sikuli Integrator C# - How to change the dircetory of SikuliOutputLog.txt?

I'm new with Sikuli Integrator in C# using Microsoft Visual Studio. May I kindly know how to change the directory of the SikuliOutputLog.txt?
1
vote
5answers
5k views

Im unable to locate the element to enter the text in the txt box in c#

i tried using xpath, Id to find elements. even though im getting the error "unable to locate the element" please can anyone help? HTML Snippet <input type="text" value="" maxlength="256" id="...
1
vote
1answer
3k views

Selenium 2 Webdriver: Persistent cookie browser restart

I test a OAuth 2 Login page. It allows me to remember my login. This is done with a persistant cookie. Now I want to test if this cookie remains present after a browser restart which is its intent: .....
1
vote
2answers
6k views

How to verify if a button is not clickable in Selenium (C#)?

Can anyone suggest a good method to use when you want to check if a element is NOT clickable. In one of my scripts, I'm trying to verify that a button clickable until a certain action is taken on the ...
1
vote
1answer
406 views

Running parallel scripting in Selenium Web driver for Firefox, do I need Selenium Grid?

I have a process, using Selenium Web driver for Firefox, for automatic look up for information on one specific site. Due to the volume of the data being looked up, I will need to run parallel ...
1
vote
1answer
777 views

Not able to click Left Navigation icon using Coded UI

I am using Coded UI for creating Automated test cases and have encountered an issue. There is a menu icon inside on the Homepage and clicking on this icon will expand the Left Navigation, so that user ...

1
3 4
5
6 7
9