In general, with Selenium 2.0 the web driver should only return control to the calling code once it has determined that the page has loaded. If it does not, you can call waitforelemement
, which cycles round calling findelement
until it is found or times out (time out can be set).