I am working for a mouse hover and i want to test all the links working condition by clicking each and every link using for loop.In my program the iteration is going once and fo
You can use following modification in your code:-
List links=driver.findElements(By.xpath("//a[contains(@class,'sf-depth-2')]")); for(int i=0;i allLinks=driver.findElements(By.xpath("//a[contains(@class,'sf-depth-2')]")); allLinks.get(i).click(); driver.navigate().back(); }