From the course: Python Automation and Testing

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

From the course: Python Automation and Testing

Start my 1-month free trial

Explicit waits

- [Instructor] An explicit wait is one where you want your code to pause until a certain condition has been satisfied. Typically in test automation scripts, if you're testing an image and you want to wait for the presence of that image to be loaded, then you will add and explicit wait. In case you do not add an explicit wait there, the image will not be loaded at the right time in your script and an element not found exception will be thrown. So it is always better to add explicit waits when expecting certain elements to take much longer to load than the other elements in the webpage, and you want to wait for those elements because they're essential to your script being able to run. The Selenium WebDriver provides a lot of convenient methods that enable you to add the required explicit waits in your code. A combination of the classes WebDriverWait and ExpectedConditions are used to add explicit waits. These convenient methods could test conditions ranging from the title list to…

Contents