Category Archives: selenium

@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. Performing the testing part will imply the use of @FindBy (of Selenium WebDriver) and List (of Java). Read on to get an idea of where this approach can be used, how @FindBy is ideal for such a task, what the basics of working with List are, and what an actual test looks like. Continue reading @FindBy, Lists and using them to check for similar UI elements

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 presented here will be available in GitHub under this location: https://github.com/iamalittletester/learning-project. Continue reading Selenium tests, the Object Oriented way – example 1 (with code)

Lessons learned at SeleniumConf 2016

I am back from the SeleniumConf UK 2016 event which took place in London, and i have to say, it was a fantastic experience.  I have seen some really great talks, got plenty of takeaways, and as an added bonus, as a speaker, i managed to get a sneak peak ‘backstage’.

All the talks are freely available, which is a major plus for this conference, so have a look  Continue reading Lessons learned at SeleniumConf 2016

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 there were test failures, but would have appeared later on. Therefore if the test would have waited a little bit before performing the presence check, it would have passed. Continue reading Selenium: How to wait for an element to be displayed / not displayed

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 is not used properly. Some tests appear to be unreliable Continue reading Selenium: How to correctly test whether an element is displayed (or not)

Quick Tip: Selenium – Taking screenshots (of regular tests and test failures)

The What

During Selenium test execution, i want to store a screenshot of what is displayed in the browser to understand in what conditions the test ran.

Continue reading Quick Tip: Selenium – Taking screenshots (of regular tests and test failures)