package testproject; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.
Please try below. It should work
List elements = driver.findElement(By.LinkText("Gmail")) elements.get(0).click().