Hey there! any question in your mind? Ask It Now!.

Popular Categories





Can i click all hyper links on web page?

+1 vote
81 views
asked in Software Testing by mHelpMe (670 points)
I have a web page and want to click all of its links is it possible?

1 Answer

+1 vote
answered by smarttester (590 points)
selected by mHelpMe
 
Best answer

Yes its possible you can store all link in an array and then click on them like this : 

ArrayList<WebElement> input_type = (ArrayList<WebElement>) driver.findElements(By.tagName("a"));
 
for (WebElement type : input_type)
{
 
 
type.click();
 
 
}
 
This will strore and all links and click them one by one.

Related Questions

+2 votes
1 answer 159 views
+1 vote
1 answer 2,316 views
+2 votes
1 answer 1,366 views
+13 votes
1 answer 146 views
+5 votes
7 answers 14,776 views
+11 votes
1 answer 151 views

Not a Member yet?

Ask to Folks Login

My Account
459 Folks are online
1 members and 458 guest online
Your feedback is highly appreciated