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
How to submit a form using selenium webdriver?
How can we fetch the page source in selenium?
What is the use of driver.get("url") and driver.navigate().to("url") command? Is there any difference between the two?
What kinds of test types are supported by selenium?
What is selenium rc?
How to get the title of the page?
What do we mean selenium selenium 1 and 2?
Explain what is group test in testng?
Explain how you can handle colors in web driver?
How do you upload a file?
what are the testing frameworks used in selenium?
What is the selenese command to show the value of a variable in the log file?
How is selenium different from qtp?
How many exemptions do you know in selenium webdriver?
What is difference between @factory and @dataprovider annotation?