0
votes

I heard that Selenium 2.0. is waiting for element or page to load by default, so there is no longer need to write specific methods like 'waitForElementToLoad' after calling click method.

Is it true? If yes, why can't I find it anywhere in documentation? I constantly find some posts like this, where it's only mentioned: Selenium - don't wait until all elements are presented

Please advice where can I find any proof of that, what methods are waiting for element to load, and from which version it is implemented?

I am using Selenium 2.0 with Chrome Driver.

Thank you.

1
Is it what you want docs.seleniumhq.org/docs/… ?olyv
Not exactly, this says what explicit and implicit waits are. I'm searching for a confirmation / proof that when using click method, you don't need to wait for elements to load, as click method has this option by default.Doszi89

1 Answers

3
votes

As in docs (http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp) :

"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."

So, you need to set it manually, ie need to wait elements to load. By default Selenium doesn't wait, as written above.

Also here: https://sqa.stackexchange.com/questions/2606/what-is-seleniums-default-timeout-for-page-loading is mentioned that "The default WebDriver setting for timeouts is never"