Disclaimer: I am relatively new to selenium and Java.

I have gone through the selenium source code and found that WebDriverWait extends FluentWait<WebDriver> and FluentWait<T> implements Wait<T>

Doesn't that make WebDriverWait the Superset which has all the methods of FluentWait and Wait class? So my quesiton is:

What is wrong(in my understanding) or what is the difference in the below code.


WebDriverWait wait = new WebDriverWait(driver, 30);


FluentWait<WebDriver> fluentWait = new FluentWait<WebDriver>(driver)
                .withTimeout(30, TimeUnit.SECONDS)
                .pollingEvery(5, TimeUnit.SECONDS)

What I am try to have is a wait object which ignores these three exceptions.


Any help is appreciated. Thanks in advance.


1 Answer 1


FluentWait: According to your code snippet, it will wait for the expected web element upto 30 seconds. And it will check the condition (or in simple words, look for the element) every 5 seconds within the 30 seconds time limit.

You can use FluentWait when your web element appears or loads between some time interval.

WebDriverWait: The WebDeiverWait code snippet will also wait for the element for 30 seconds. But it will look for the element every 0.5 seconds (500 ms) by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.