I am using the latest version of webdriver. While I can select the right links it seems as the wrong links are actually clicked.
Here is some code to use for Google. What it does is simply clicking a result of a Google Search.
@FindBy (id ="ires")
private WebElement searchResults;
public void clickResult(int i) {
initPage();
List<WebElement> resultLinks = getSearchResultLinks();
resultLinks.get(2).click();
}
private List<WebElement> getSearchResultLinks (){
return searchResults.findElements(By.className("l"));
}