Generally in automation, sometimes few elements takes time to appear on page when browser is loading the page.
In this case, sometime your webdriver test will fail if you have not applied wait in your test case.

In order to handle the this type of situations, we have wait(implicit, explicit and fluent-wait) concepts.

Implicit wait:
Implicit waits are used to provide a default waiting time (say 20 seconds) between each consecutive test step/command across the entire test script.
If implicit wait is applied in your test case then webdriver will wait for specified amount of time if targeted element not appears on page.

Implicit wait Code :
driver.manage().timeouts().impicitlyWait(20,TimeUnit.SECONDS);


Categories: