How does you identify the list of links present on the page
Answer Posted / नितिन
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 View All Answers
What are the capabilities of selenium ide?
How to send alt/shift/control key in selenium webdriver?
How do you identify an object using selenium?
What is junit annotations and what are different types of annotations which are useful?
How to test ajax application with selenium?
Explain me how can we capture screenshots in selenium?
Other than the default port 444 how you can run selenium server?
What do we mean by selenium 1 and selenium 2?
Is selenium server needed to run selenium webdriver scripts?
What is actions class in webdriver
What exactly is selenium remote-control (rc) tool?
What are the advantages of the automation structure?
Define selenium 2.x?
How could ajax controls be handled in webdriver?
What is testng?