In my project I use findElement(By.linkText("")).click();
but in the web page I'm using, many links have the same name(btw I can use By.linktext only) so i want to know it its possible to navigate among the links which have the same name
Also when i use List<WebElement> h=driver.findElements(By.linkText("Years"));
and print it:
[[[FirefoxDriver: firefox on LINUX (f5681889-d73a-4a0f-88e9-2e189491049b)] -> link text: Years],[[[FirefoxDriver: firefox on LINUX (f5681889-d73a-4a0f-88e9-2e189491049b)] -> link text: Years],[[[FirefoxDriver: firefox on LINUX (f5681889-d73a-4a0f-88e9-2e189491049b)] -> link text: Years],
update: In the page im working on, every 2nd link text with the same name is where i would like to go to, also there isnt any difference in those links except their description eg: link 1: Years ABC(description)
link 2: Years XYZ(description) can i use the description as a condition in any way??