Find all the Links on a Webpage with Selenium WebDriver in Java

Posted by & filed under Selenium WebDriver, Test Automation, UI Testing.

1 minute read Here is how you can find all the Links on a Webpage with Selenium WebDriver in Java. All you need to do is to create a list of all WebElements, and then iterate thorough the list of links to print the link and the text of the link: List allLinks = driver.findElements(By.tagName(“a”)); System.out.println(“All links found… Read more »