All posts by iamalittletester

Refactoring is allowed

Writing automated tests means writing code. It means going through processes that regular code goes through. Like code review, and refactoring. I see a lot of hesitation when it comes to refactoring one’s own code, possibly because we feel that if our code needs correction, we did a crappy job writing it the first time. But that is not the case, and refactoring should be seen as a good thing. It is meant for changing something from good to even better. Continue reading Refactoring is allowed

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 the two might contain. Continue reading thewaiter: wait for WebElement text. To equal, contain a String with variations.

thewaiter: wait for an element to be displayed with Selenium

A very hot topic when testing with Selenium is how to wait for a WebElement to be displayed. I wrote about this some while back, and that post is one of my most read on this blog. In this new post i will revisit the subject, by providing a new version of that method, using Java 8. It can be found in ‘thewaiter’ library in two variants: with a default timeout, and with a signature that allows a timeout parameter to be specified when calling it. Continue reading thewaiter: wait for an element to be displayed with Selenium