Computer Science, asked by Noni632, 11 months ago

How to click on all links in a page using selenium webdriver?

Answers

Answered by Anonymous
4
List allLinks = driver.findElements(By.tagName("a"));

System.out.println("All links found on web page are: " + allLinks.size() + " links");

for (WebElement link : allLinks) {

//print the links i.e. http://example.com or https://www.example.com. ...

//print the links text.

System.out.println(link.getText());

hope \: helps
Answered by Anonymous
2
¶ Capture all links under specific frame|class|id and Navigate one by one.

¶ Capture all links [Alternate method]

Hope Helps ♥️
Similar questions