The code snippet below works fine, but I\'m having a little trouble with the wait.until()
line:
wait.until(new ElementPresent(By.xpath(\"//a[@title=
I use PageFactory with AjaxElementLocatorFactory - PageFactory is a support class for the Selenium 2 Page Objects pattern which you are using, and the AjaxElementLocatorFactory is the factory for the element locators. In your case the constructor will looks like:
public GoogleResultsPage() {
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 15), this);
}
This code will wait maximum of 15 seconds until the elements specified by annotations will appear on the page, in your case the homePageLink which will be located by xpath. You will not need to use ElementPresent class.