thewaiter: wait for WebElement text. To equal, contain a String with variations.

Element text is something you will often check for when writing Selenium tests. Whether it equals a given String, or contains a given String. But you can extend your checks to whether: the element text equals/contains a String ignoring the case of the two, or whether the element text equals/contains a String ignoring any whitespace… Read More

@FindBy, Lists and using them to check for similar UI elements

This is going to be a rather complex post, that will show how to easily check for values of similar UI elements. By similar i mean elements that share some kind of properties: whether they have the same CSS selector, or are part of the same group of elements. Some examples will be shown below.… Read More

Selenium tests, the Object Oriented way – example 1 (with code)

This is going to be a follow-up post in regards to the approach i showed at my SeleniumConf talk, on doing Selenium tests by using an Object Oriented approach. I will have a series of such posts, to show more examples and to make it easier to understand how to use it. All the code… Read More

Selenium: How to wait for an element to be displayed / not displayed

In my previous post i talked about how to check whether an element is displayed or not. There are times when tests where such an action is performed fail randomly (sometimes they will pass, other times they won’t). The assumption here is that the element was not displayed within a decent amount of time when… Read More

Selenium: How to correctly test whether an element is displayed (or not)

One of the most frequent kind of interactions with the web page when testing with Selenium is checking whether a particular element is present. More specifically, whether it is visible when looking at the page and does not have a “hidden” attribute. The isDisplayed() method is used for such checks, but in many cases it… Read More

Quick Tip: Running automated tests in parallel

The What I have a bunch of tests that i would like to run faster, by making them execute in parallel. In my tests: I am not using a DataProvider and only want to make the same test run several times. I am using a DataProvider and want my test to run with the provided… Read More

Quick Tip: Selenium – select / deselect a value from a dropdown

The What Having an HTML dropdown on a web page, i would like to select, via Selenium, an element from it, or deselect the selected one. An example of an HTML representation of a dropdown can be found below – it displays a list of winter months: <select id=”winter”> <option value=”Dec”>December</option> <option value=”Jan”>January</option> <option value=”Feb”>February</option>… Read More