Using Wait with Selenium in Python.

Why to Use Wait:  Most of the web apps are using AJAX techniques, This makes page element is loaded to browser may load at different time intervals.Using waits, we can solve this issue as Wait provides the time interval and some conditions to locate element.

Hence we can avoid the ElementNotVisibleException exception.

Selenium Webdriver provides two types of waits:


Explicit Waits:-

An explicit wait makes WebDriver to wait for a certain condition to occur before proceeding further with executions. There convenience methods provided that help you write code that will wait only as long as required. Using WebDriverWait in combination with ExpectedCondition is one way this can be accomplished.




Below is the Expected Conditions that are used when automating web browsers.

-invisibility_of_element_located etc.

Implicit Waits:-

Its used to tell WebDriver to search the DOM for a certain amount of time to find an element or elements if they are not immediately available.

In the next blog, We will see the Page Object and other important topics in Python.

Source Code Here.

2 thoughts on “Using Wait with Selenium in Python.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.