Refrence: Speeding up end-to-end tests

I tried removing ImplicitWaits and I found myself ending up writing too much code for every click and sendkeys etc. I have to put wait condition for every base function.

Implicit Wait:

public WebDriver openBrowser() {
 System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + getProperty("chromeDriver_exe"));
            driver = new ChromeDriver();
 driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);


Click Function:

public void click(String locatorKey) {
        //Put Wait condition else element will be remain unattended/notFound

        logger("Clicked on " + locatorKey);
  • What is your question? Where do you want to remove implicit wait from? why do you need to wrap each click in own function?
    – Alexey R.
    Commented Jun 23, 2018 at 20:58

3 Answers 3


If you really want to speed up your e2e tests, I don't think replacing all implicit waits by fluent wait will help that much. Instead, i would suggest exploring selenium grid or cloud based solutions like saucelabs.

Practically we do use both implicit and fluent wait for different purposes depending on the scenario.

  • Yes, I agree it is not an replacement, both have their own places based on scenarios however instead of having large implicit waits I prefer short implicit waits coupled with conditional waits based on each individual scenarios. Commented Jun 24, 2018 at 20:12
  • I never wrote it is only a difference maker, but it could be one among many like you listed. I have already provided the reference which has list of ways which can speed up tests.
    – paul
    Commented Jun 25, 2018 at 4:10

Use Explicit or FluentWait instead of implicit wait.

Why not implicitWait for everything?

So, there are certain elements that might take longer to load or there is a certain amount of uncertainty in the loading time. So, waits should be used for such elements only.

I would call it a deliberate exemption but not every element should enjoy this exemption. With implicit wait, every page element have this luxury to be loaded within the time defined for implicitWait which should not be the case. If regular page elements are taking time to load then we want to know this as this might be a potential issue.

Why implicitWait?

So, in case, if overall, the website is slow but we still want to go ahead with functional automation then implicitWait is a good option with a time value of 500ms to 1 sec or whatever required. Now, this value will apply to all the elements however, you find some of the page elements (which are important for automation) taking longer than usual then explicit or fluentWait should be used for such elements.


Yes, I would suggest using fluent wait in each base action methods like click,enterText, select etc.

It tries to find the web element repeatedly at very short intervals of time until the timeout or till the object gets found instead of longer static waits for every object.

This saves huge time in larger automated suites.

Code Example:

browser.wait(function () {
    return element(by.id('id1')).isDisplayed()
        function (isDisplayed) { 
            return isDisplayed; 
        function (error) { 
            return false 
}, 20 * 1000);

Note: By making the implicit wait to zero, we are making sure that the implicit wait timeout does not interfere with our polling interval.

  • Do you mind sharing the one that you wrote? If it was so useless why it was there at all since beginning of selenium?
    – paul
    Commented Jun 24, 2018 at 3:42
  • Added an example. Commented Oct 17, 2018 at 9:48

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.