Hot answers tagged

39 votes

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

One of the biggest mistakes in my career was to pick a different programming language for the test automation than the development team uses. You won't get help from the development team when you ...
user avatar
14 votes

How does one get started with web test automation using Selenium?

How to get started with Selenium: A Brief Overview So you want to automate browser-driven tests, and you're not sure where to get started. You've heard of this "Selenium" thing, and you ...
user avatar
  • 3,344
14 votes

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

You can choose any language irrespective of which language is used in development. But it would be better if you go with same programming language which is used in the development, in your case it ...
user avatar
  • 1,795
11 votes
Accepted

How does one get started with web test automation using Selenium?

To broadly address your question, just pick some test cases with simple interactions that aren't very dynamic and automate those. Trial, error, and practice will get you there. Is Java mostly used ...
user avatar
10 votes

Selenium Webdriver, C# and accessing rows in a table

Get the table, then its rows, then each row's TDs, then each TD's anchor: var table = driver.FindElement(By.TagName("table")); var rows = table.FindElements(By.TagName("tr")); foreach (var row in ...
user avatar
  • 4,030
9 votes
Accepted

Why does selenium fail every so often when running more complex tests because it can't find an element on the page?

WaitForPageLoad() continue's after all the data for the page has been retrieved and I think when the browser OnLoad() function is called. Its possible the browser is still executing JavaScript or ...
user avatar
9 votes
Accepted

How to disable infobar from Chrome

Disabling infobars is not supported anymore by Chromium. According to them, Remove --disable-infobars. This flag is no longer needed by the perf testing infrastructure and can be misused ...
user avatar
  • 624
9 votes
Accepted

API Testing tools in C#

You can use the combination of any unit testing framework (like NUnit, MSTest, XUnit) with additional nuget packages for the work with REST API itself RestSharp (http://restsharp.org/) Probably the ...
user avatar
9 votes
Accepted

Is there any way to click on 6th item of this list

You can use a CSS Selector looking for a substring at the onclick attribute: div[onclick*='2005256'] This will look for the client regardless of the position. If you want by position: #searchpanel-...
user avatar
  • 9,816
9 votes

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

Definetly learn C#. Why? At Selenium tests level it's basically the same thing as Java 9. With a bit of syntactic sugars. It shouldn't take you more than 2 weeks to get up to speed with C#. CI/CD and ...
user avatar
8 votes
Accepted

Selenium PageFactory vs Page Object Model

Page Object and Selenium's PageFactory are distinct things in nature, usually the latter complement the former. Page Object is a design pattern aimed at solving the problem of separating the ...
user avatar
  • 9,816
7 votes
Accepted

How to change the Text of a IWebElement of Selenium in C#

Quickly glanced over the properties and methods of IWebElement, doesn't look like they can set values. However, you can easily execute some javascript snippet to change HTML in your page. IWebDriver ...
user avatar
  • 5,834
7 votes
Accepted

Adding user-data-dir option to ChromeDriver makes it not work and timeout only

After further research, come across the following links: https://github.com/SeleniumHQ/selenium/issues/886 https://code.google.com/p/chromedriver/issues/detail?id=962 http://peter.sh/experiments/...
user avatar
  • 261
6 votes

Are Selenium functional tests reliable enough to be worthwhile?

NONONONONO. All above posters have it wrong. Polling and latching and what not do not account for INHERENT RANDOMNESS or SELENIUM BUGINESS . Why does a test fail and turn red in Jenkins or some ...
user avatar
6 votes
Accepted

Sikuli and it's effectiveness with .NET

There are three .Net wrappers for Sikuli. Personally, I was a bit disappointed in all of them. Edit: there was a small bug in SikuliSharp which was causing commands to Sikuli to fail. Now that this ...
user avatar
  • 5,834
6 votes

Where tools for automated UI test like selenium or Coded UI fits in Dev Ops cycle

In this context, a goal you most likely want to achieve is one of Continuous Integration (CI). To that end, from the developer side, every check-in will trigger a build (to perform certain checks and ...
user avatar
  • 5,834
6 votes
Accepted

How to select an unordered list in Selenium using C#

Your problem is with the selector indeed. Issue 1 When using XPath in the context of another element (as you are doing), always start the XPath with a dot (which represent the element you are ...
user avatar
  • 5,834
6 votes

API Testing tools in C#

Writing an API test in Visual Studio can be done with: NUnit or MSTest as your Test Runner ** NUnit and the TestAdapter are available on Nuget An http client, like .Net's HttpClient ** This is in the ...
user avatar
  • 4,030
6 votes
Accepted

How to select the second tr of my HTML?

To add explanation to what you have already figured out. The problem was that with this line you correctly acquired the second row: IWebElement secondRow = driver.FindElement(By.CssSelector("table tr:...
user avatar
6 votes

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

Some options in my order of preference: Probably you do not want to test the TwoFactorAuth, but you want to test the application behind it. Consider building a backdoor which is only enabled in the ...
user avatar
5 votes
Accepted

Selenium - advantages and disadvantages of using Python vs C#

To play a devil advocate, if you try Python, you will find that you are substantially more productive because of dynamic typing. Python just works much harder to improve productivity of the programmer,...
user avatar
5 votes
Accepted

Unit tests: avoiding overspecification

You should avoid doing assertions on the method's innards as much as possible, to avoid coupling the unit tests to implementation specific details. In reality, of course, that's not always possible. ...
user avatar
  • 166
5 votes

How does one get started with web test automation using Selenium?

Start by looking for testing tasks that require a lot of manual effort and do not change from one release to the next. This is especially important for UI automation; if a web page changes frequently,...
user avatar
  • 22.8k
5 votes
Accepted

How to wait for element to be clickable in WebDriver with C#

Below code should help you. public static class WebDriverExtensions { public static IWebElement FindElement(this IWebDriver driver, By by, int timeoutInSeconds) { if (timeoutInSeconds &...
user avatar
5 votes

Can NUnit be used for Functional and Regression testing?

Yes, you can use NUnit for functional testing. But still it is a unit-testing framework. No, you are not creating unit-tests by using a unit-testing framework to write functional tests. A unit-test is ...
user avatar
5 votes
Accepted

Do we really need testing framework when creating automation tests in C#?

No, technically you do not need a unit-testing framework. You could just execute Selenium steps from a C# program and write the results somewhere for you to monitor, but we use them as a runner of the ...
user avatar
5 votes

C# WebDriver StaleElementReferenceException

StaleElementReferenceException is really common with Selenium. To avoid these issues you should be waiting for an element to load before manipulating it (clicking, sending keys, etc). This will ...
user avatar
  • 3,685
5 votes

How much C# should I learn in order to work with CodedUI?

If you are concerned about learning too much, you are doing it WRONG. The more you learn, the easier it will be for you to solve common problems. We are getting questions DAILY here which would be ...
user avatar
5 votes

Exception while in a for-each loop in C# Selenium

You are likely getting a StaleElementException. When you first get the list of elements to click, they are attached to the current DOM. After navigating away (the first time) the elements are no ...
user avatar
  • 4,030
5 votes
Accepted

Selenium C# - How to wait with WebDriverWait using the element as parameter instead of a locator?

The easiest way is to create your own ExpectedConditions class with methods accepting a WebElement as parameter, for example: Wait.Until(MyConditions.ElementIsVisible(element)); With the ...
user avatar
  • 5,834

Only top scored, non community-wiki answers of a minimum length are eligible