565 views 23 secs 0 comments

Using Selenium WebDriver Waits as Retries in Your Tests

In General
April 15, 2021


qautomation news

QAutomation News / By  Corina Pip 

The topic of Selenium tests failing due to timing issues comes up quite a lot. Random failures are attributed to the interaction being done too early, when the page has either not properly loaded, or when the WebElements themselves were not fully initialized. The biggest issue occurs when JavaScript is involved in rendering page elements.

Although in some cases testers will try to use Selenium WebDriver wait methods to wait for certain conditions to be fulfilled before trying the interaction, they might still get test failures. So what would be a good solution to have reliable tests? 🤔 Read on to see how we can create aggregated wait methods that will allow us to retry complex conditions.

The WebDriverWait class and methods

Before we start writing our aggregated wait methods, we need to look a little bit at the WebDriverWait class from Selenium. It allows us to create custom wait methods in our tests,…



Continue reading on source link

Leave a Reply
You must be logged in to post a comment.