views:

33

answers:

1

I'm using Selenium 2 in Java, and when loading a web page using Webdriver's (the InternetExplorerDriver class) get() method a time-out is received and the execution halts although the page appears as completely loaded to me.
I've tried using the WebDriverWait class but I can't figure out what function to provide as the condition to the until() method .
Update: implemented the Condition class, but now can't figure out whether the wait.until() method should be used before or after the get()...

A: 

Probably your page have some AJAX so WebDriver thinks that it is loaded, while it is not yet. You should utilize Page Objects pattern and AjaxElementLocatorFactory - its more reliable then just using wait. Also this pattern allows creation of maintainable tests and have many advantages

ZloiAdun
akapulko2020
In this case you still need to wait for objects to be loaded, and using PageFactory is a good way to do so. However you may need to switch to the iframe before initializing your page object
ZloiAdun
Thank you very much for your help. I still don't understand how can I use switch to iframe if the driver.get() is not back yet... Perhaps there is an example for the PageFactory pattern that you described, except the one you'be linked originally? (I can't seem to be able to post any message on Selenium google group as I'm a new user and the moderators' approval seems to never occur :))
akapulko2020
take a look at this - http://zloiadun.blogspot.com/2010/08/using-page-object-pattern-for-web.html
ZloiAdun