From the course: Selenium Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Explicit waits

Explicit waits - Selenium Tutorial

From the course: Selenium Essential Training

Start my 1-month free trial

Explicit waits

- [Instructor] The explicit wait waits for a specified amount of time for a certain condition to be true. If the condition is not met in the time specified, an exception is thrown. The explicit wait is intelligent. It gives better options than an implicit wait. It allows for more flexibility as it will wait for dynamically located elements. The first step to using explicit wait is to define a new wait object by specifying web driver wait wait is equal to new web driver wait. This is part of the web driver wait class, and this method takes the driver and the max time to wait in seconds as parameters. Once the wait object is declared, we use that wait in addition to expected conditions to specify what we are waiting for. One example of expected conditions is to wait for an element to become visible. So putting that into a sample statement, that can be declared by web element element is equal to wait until expected…

Contents