Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

What are the different types of Waits available in WebDriver?

When performing automation testing with Selenium, we can use different types of Waits:

  • Thread.Sleep() Method
  • Implicit Wait
  • Explicit Wait
  • Fluent Wait

Thread.Sleep() Method: The Thread.Sleep() method, which belongs to the thread class and can be called using a reference of the class name, i.e., Thread, can be used while performing automation testing with Selenium. This method will stop the execution of the script for the specified duration of time, irrespective of whether an element is found on a web page. It accepts a time duration in milliseconds.

Implicit Wait: With Implicit Wait, Selenium has overcome the problems of Thread.Sleep(). Implicit Wait allows you to pause the WebDriver for a particular time until it can locate a desired element on the selected web page.

Explicit Wait: The Explicit Wait is one of Selenium's dynamic waits. It lets you pause the execution of your script until an element is visible on a web page. If the specified amount of time passes without the element appearing, you will get an ElementNotVisibleException.

Fluent Wait: In terms of its functionality, the Fluent Wait is similar to Explicit Wait. While you perform a Selenium Wait for an element when you are unaware of the time it may take to be visible or clickable, you use a Fluent Wait when you know how long the element will be visible.

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free