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 is difference between @factory and @dataprovider annotation?

1001


Is there a way to refresh browser using selenium?

977


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

899


What you say in regards to the flexibility of selenium test suite?

956


What is the difference between verification and assertion?

863


How to check whether a text is underlined or not?

928


What are the types of webdriver apis available in selenium?

1555


Explain the difference between assert and verify commands?

984


How to click on a hyper link using linktext?

930


What is the difference between selenium and sikuli?

1143


What is the command line we have to write inside a .bat file to execute a selenium project when we are using testng?

990


Tell us what are the two modes of views in selenium ide?

865


What do we mean by selenium 1 and selenium 2?

870


What is the difference between “/” and “XPath //”?

1144


How can we find all the links on a web page?

941