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

Popular Categories





Can i click all hyper links on web page?

+1 vote
87 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 177 views
+1 vote
1 answer 2,344 views
+2 votes
1 answer 1,403 views
+13 votes
1 answer 168 views
+5 votes
7 answers 14,864 views
+11 votes
1 answer 165 views

Not a Member yet?

Ask to Folks Login

My Account
541 Folks are online
0 members and 541 guest online
Your feedback is highly appreciated