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 are the main advantages of automation testing?

0 Answers  


How you can use “submit” a form using selenium?

0 Answers  


What is the wait? How many types of waits in selenium?

0 Answers  


What is framework and what are the frameworks available in rc?

0 Answers  


What is the difference between single and double slash in xpath?

0 Answers  






What are core extension?

0 Answers  


What is selenium-rc (remote control) ?

0 Answers  


What are some advantages of selenium grid?

0 Answers  


What are the prerequisites to run selenium webdriver?

0 Answers  


Tell me how can we launch different browsers in selenium webdriver?

0 Answers  


what are the Dynamic elements in web Application?

2 Answers   Eton, HCL,


What is the use of driver.get("url") and driver.navigate().to("url") command? Is there any difference between the two?

0 Answers  


Categories