Synchronizing a test with an explicit wait
The Selenium WebDriver also provides an explicit wait for synchronizing tests, which provides a better control when compared with an implicit wait. Unlike an implicit wait, you can write custom code or conditions for wait before proceeding further in the code.
An explicit wait can only be implemented in cases where synchronization is needed and the rest of the script is working fine.
The Selenium WebDriver provides WebDriverWait
and ExpectedCondition
classes for implementing an explicit wait.
The ExpectedCondition
class provides a set of predefined conditions to wait before proceeding further in the code. The following table shows some common conditions that we frequently come across when automating web ...
Get Selenium Testing Tools Cookbook 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.