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 programming languages does Selenium use?

0 Answers  


Is it possible to automate the captcha using selenium?

0 Answers  


How to handle ajax calls in selenium webdriver?

0 Answers  


What evaluation can selenium do?

0 Answers  


What is the difference between driver.findelement() and driver.findelements() commands?

0 Answers  






its urgent, am trying for jobs. can anyone tell me please in corporate environment , how do we generate reports using selenium? is it default report or xslt report or custom report?? its very urgent.. thanks in advance

2 Answers  


How to handle alerts in selenium webdriver?

0 Answers  


Explain how you can handle colors in web driver?

0 Answers  


List some advantages of test automation?

0 Answers  


What is selenium?

1 Answers  


How to check whether a text is underlined or not?

0 Answers  


How you will login into any site if it is showing any authentication popup for username and password?

0 Answers  


Categories