Prasad
Prasad

Reputation: 956

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

Upvotes: 2

Views: 31404

Answers (2)

JeffC
JeffC

Reputation: 25744

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.

Upvotes: 6

Yahya Hussein
Yahya Hussein

Reputation: 9121

An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements (if) they are not immediately available. The default setting is 0. Once set, the implicit wait is set for the life of the WebDriver object instance.

Upvotes: 0

Related Questions