Synchronizing a test with FluentWait

The FluentWait class is an implementation of Selenium WebDriver's Wait interface. Using the FluentWait class, we can define the maximum amount of time to wait for an element or condition as well as the frequency with which to check for the condition. We can also configure it to ignore specific types of exceptions such as the NoSuchElement exception while searching for an element.

Unlike implicit and explicit wait, FluentWait uses a maximum timeout value and polling frequency. For example, if we set the maximum timeout value as 20 seconds and polling frequency as 2 seconds, WebDriver will check for an element every 2 seconds until the maximum value. In addition to this, we can configure FluentWait to ignore specific ...

Get Selenium Testing Tools Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.