1

Implicit wait is global in nature while explicit wait is applied for some particular operation to happen. Then why to use explicit wait, if we can overcome the problems using implicit wait?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

1

Implicit wait is easy and simple to apply however it has some downsides. It is a single line of a code that is declared in a setup method and applies to the entire test script.

By using Explicit Wait command, the WebDriver is directed to wait until a certain condition (Expected Condition) occurs before proceeding with executing the code e.g. "visibilityofElementLocated".

Setting Explicit Wait is important in cases where there are certain elements that naturally take more time to load. If one sets an implicit wait command, then the browser will wait for the same time frame before loading every web element. This causes an unnecessary delay in executing the test script.

Explicit wait is more intelligent, but can only be applied for specified elements. However, it is an improvement on implicit wait since it allows the program to pause for dynamically loaded Ajax elements.

Sachin S
  • 11
  • 1