-1

I'm giving implicitly wait is 20 seconds explicit wait also give 20 seconds so to finding to the explicit until condition with find element how much time to take a web driver

Code:

driver.manage().timeouts().implicitlyWait(23, TimeUnit.SECONDS);
new WebDriverWait(driver, 23).until(ExpectedConditions.elementToBeClickable(element));
Ishita Shah
  • 3,955
  • 2
  • 27
  • 51

2 Answers2

0

It wouldn't make any difference if you have given that way, it would take 20 seconds.

Implicit wait start working when you call findElement function, but explicit wait will work by repeatedly calling findElement until the element is found. So If you give implicit wait 60 seconds and Explicit wait 70 seconds, then it would wait for 120 seconds because when the first time explicit wait calls the findElement, implicit wait will hold it for 60 seconds and then it will release the control, but Explicit wait still have 10 seconds, so at 61 seconds, it will once again call findElement function, now since Implicit wait is 60 seconds, it will wait for another 60 seconds, so it takes 120 seconds. Now you can see eventhough you set Implicit wait for 60 seconds and Explicit wait for 70 seconds, it would mess up things and ultimately wait for 120 seconds, so never combine both.

And also Implicit wait is in the driver, Explicit wait is in the local language binding.

Rajagopalan
  • 5,465
  • 2
  • 11
  • 29
0

Answering straight, as per the documentation of Explicit and Implicit Waits mixing up Implicit Waits and Explicit Waits can result in unpredictable wait times.

As an example, setting an Implicit Wait of 10 seconds and an Explicit Wait of 15 seconds, could cause a timeout to occur after 20 seconds.

References

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