Search code examples
javaseleniumwait

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS) does not working


driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

The above implicity wait code is not working for me on Google chrome. I have tried with selenium 2.47 and 2.53.1


Solution

  • You should read up on what implicit wait actually does and how it works.

    http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#implicit-waits

    It's not something that you call to wait for 10 seconds, it only comes into play when an element that is being searched for is not available... then the implicit wait is triggered and that element is polled up to the 10s. If the element is already there, then there is no wait time. Thread.sleep() pauses execution no matter what but is not a good practice.