The weird true story of Selenium, the StaleElementReferenceException, the iframe, the List and the WebElement

I write a lot of automated tests. Most of the times, it all goes nice and smooth, like a good song. But once in a while i run into an automation situation that leaves me completely baffled. Debugging does not reveal how to fix it, and it is not very obvious to me what is… Read More

Better Test Code Principles #5: Mind your try/catches

Using try/catches to handle exceptions has become quite fashionable when writing tests with Java. However, this approach is also a frequent source of having false positives while running tests. Many times when writing the tests people forget to consider both sections of this code block: they forget to write the appropriate code in both sections… 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