Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How does you identify the list of links present on the page



How does you identify the list of links present on the page..

Answer / नितिन

WebDriver driver = new FirefoxDriver();

driver.get("http://toolsqa.wpengine.com/");

java.util.List<WebElement> links = driver.findElements(By.tagName("a"));

System.out.println(links.size());

for (int i = 1; i<=links.size(); i=i+1)

{

System.out.println(links.get(i).getText());

}

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Selenium Interview Questions

What is pom (page object model)? What are its advantages?

0 Answers  


What are the different Exceptions in selenium?

0 Answers  


What is regular expressions? How you can use regular expressions in selenium?

0 Answers  


How do you Upload or Download a File in Web Application?

2 Answers   HCL,


What is selenium? What are different selenium components?

0 Answers  


What is the significance of testng.xml?

0 Answers  


Tell us how you can use recovery scenario with selenium?

0 Answers  


What is the alternative to driver.get() method to open an url using selenium webdriver?

0 Answers  


Tell me how colors could be handled in selenium webdriver?

0 Answers  


what is the difference between type keys and type commands?

1 Answers  


What are the drawbacks of selenium ide

0 Answers  


How will u write page object models and data driven model.

0 Answers   Cognizant,


Categories