O'Reilly logo

Selenium Essentials by Prashanth Sams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Waits

Wait commands let you put tests on hold or pause for a few seconds or even days. Nowadays, Ajax-based websites are widely in used for their high data-exchanging speed. However, there will be variations in receiving each and every Ajax web service on a fully loaded page. To avoid such delays and to ignore exceptions such as ElementNotVisibleException, it is highly recommended to use waits. To handle such delays on a web page, Selenium WebDriver makes use of both implicit and explicit waits.

Explicit wait

An explicit wait waits for certain conditions to occur. It results in TimeoutError only when the conditions fail to meet their target. In general, the usage of the explicit wait is highly recommended. Here's an example of an explicit wait: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required