Implicit Wait

One Setting for All findElement Calls

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

driver.findElement(By.id("login-btn")).click();
driver.findElement(By.id("welcome")).getText();   // retries for up to 10 s until the element exists
  • Set once after creating the driver; applies to every findElement / findElements.
  • It only waits for an element to be present in the DOM, not visible or clickable.
  • findElements waits the full 10 s before returning an empty list, which makes "is it absent?" checks slow.

Other Timeouts

TimeoutCodeDefault
Page loadtimeouts().pageLoadTimeout(Duration.ofSeconds(30))300 s
Async scripttimeouts().scriptTimeout(Duration.ofSeconds(20))30 s
Implicittimeouts().implicitlyWait(Duration.ofSeconds(10))0 s (off)