Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the capabilities of selenium ide?

1060


How to send alt/shift/control key in selenium webdriver?

1544


How do you identify an object using selenium?

1068


What is junit annotations and what are different types of annotations which are useful?

1021


How to test ajax application with selenium?

1142


Explain me how can we capture screenshots in selenium?

972


Other than the default port 444 how you can run selenium server?

1281


What do we mean by selenium 1 and selenium 2?

939


Is selenium server needed to run selenium webdriver scripts?

970


What is actions class in webdriver

992


What exactly is selenium remote-control (rc) tool?

1098


What are the advantages of the automation structure?

1088


Define selenium 2.x?

1124


How could ajax controls be handled in webdriver?

1053


What is testng?

1023