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 ...
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 ...
  • 3,342
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 ...
  • 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 ...
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 ...
  • 4,040
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 ...
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 ...
  • 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 ...
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-...
  • 10.1k
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 ...
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 ...
  • 10.1k
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 ...
  • 5,894
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/...
  • 261
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 ...
  • 5,894
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 ...
  • 5,894
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 ...
  • 5,894
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 ...
  • 4,040
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:...
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 ...
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,...
  • 23.1k
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 &...
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 ...
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 ...
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 ...
  • 3,725
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 ...
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 ...
  • 4,040
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 ...
  • 5,894
5 votes
Accepted

Useful real-world APIs to test against

GitHub is really useful for lists of resources and I came across one yesterday that is a collection of free APIs for use in web development. <- I think you'd be good to test most any of these APIs ...
  • 3,725
4 votes
Accepted

Coded UI - How to launch website in IE InPrivate Browsing mode?

You can run it using BrowserWindow.Launch("http://www.google.com/", "-private"); Official information is available on CodeProject.
4 votes
Accepted

Set date in datepicker using Selenium WebDriver and C#

As the Datepicker is not your code you don't need to test it's functionality, so what I would do is write a JavaScript snippet that sets it to the required value, then execute that in the browser.
  • 266

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