Implict Vs Explicit Wait in Selenium - Software Testing

Empowering Technology

Post Top Ad

Responsive Ads Here

Dec 3, 2019

Implict Vs Explicit Wait in Selenium

Wait is an important term while writing automated Test Scripts using Selenium as some Web Elements might not be clickable while performing actions on them or they might take some time to load. 

We might get runtime errors like:
org.openqa.selenium.WebDriverException: Element is not clickable at point. Other element would receive the click.

We widely use two kinds of Wait in Selenium:  Implicit Wait and Explicit Wait.

Implicit Wait 
Implicit wait waits for a certain defined period of time. Example in below code snippet.

Explicit Wait 
Explicit Wait is far better than Implicit Wait as it waits for any Web Element which does not load due to Ajax or JavaScript calls on webpage. 

Sample Common Functions to be used for Implicit & Explicit Wait:

No comments:

Post a Comment

Thanks a lot for your valuable Comment!

Post Bottom Ad

Responsive Ads Here