How do you make Selenium 2.0 wait for the page to load?
You can explicitly wait for an element to show up on the webpage before you can take any action (like element.click())
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(new ExpectedCondition(){
@Override
public WebElement apply(WebDriver d) {
return d.findElement(By.id("myDynamicElement"));
}});
This is what I used for a similar scenario and it works fine.