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.

What are waits and why do we need them?

What are waits and why do we need them?

From the course: Python Automation and Testing

Start my 1-month free trial

What are waits and why do we need them?

- [Instructor] Waits are very important when it comes to placing your automation script. Most websites today use asynchronous techniques such as Ajax. When a webpage is loaded by the browser, the elements may be loaded at different time intervals due to this. So elements may take much longer to load as compared to others. This could be something like an image, a video, or any other element that requires more time to load. This poses a problem while locating elements on a page. If an element is not found by a script at that time, an exception is raised and your script will run into an issue and stop. This is where waits come into the picture. Waiting adds a time interval between the actions performed by the WebDriver. That is, it adds a wait between locating elements and performing operations on them. The selenium WebDriver provides two types of waits, explicit and implicit. An explicit wait stops execution until a certain condition is satisfied. An implicit wait on the other hand…

Contents