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 some of the advantages of selenium grid?
What you know about selenium?
What is a data driven framework?
What evaluation can selenium do?
How can you find broken links in a page using selenium webdriver?
What is the selenium's recording language?
Explain what is group test in testng?
Tell me how to verify tooltip text using selenium?
How to get a text of a web element?
What are the junits annotation linked with selenium?
What are the verification points available in selenium?
Explain the meaning of assertion in selenium and what are the types of assertion?
Explain what are the junits annotation linked with selenium?
How to highlight element using selenium webdriver?
What is the use of get options () method?