</>

Technology

Selenium

Difficulty

Beginner

Interview Question

What is Implicit Wait in Selenium?

Implicit Wait sets a global timeout for WebDriver to poll for an element before throwing NoSuchElementException.

Answer

Implicit Wait sets a default timeout for the WebDriver to poll the DOM repeatedly until an element is found, before throwing NoSuchElementException.

How to set:

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

How it works:

  1. You call driver.findElement(By.id("btn"))
  2. WebDriver polls the DOM for up to 10 seconds
  3. If found before 10s → proceeds immediately
  4. If not found in 10s → throws NoSuchElementException

Key characteristics:

  • Set once per driver session — applies globally
  • Polls at approximately 500ms intervals
  • Applies only to findElement() and findElements()
  • Does NOT work with ExpectedConditions

Example:

Java
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
driver.get("https://automateqa.online");
WebElement el = driver.findElement(By.id("result")); // Waits if not immediately available

Warning: Mixing implicit and explicit waits can cause unpredictable wait times. Choose one strategy per project.

Follow AutomateQA

Related Topics