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

How to submit a form using selenium webdriver?

1105


How can we fetch the page source in selenium?

946


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

1007


What kinds of test types are supported by selenium?

827


What is selenium rc?

869


How to get the title of the page?

929


What do we mean selenium selenium 1 and 2?

922


Explain what is group test in testng?

926


Explain how you can handle colors in web driver?

1047


How do you upload a file?

984


what are the testing frameworks used in selenium?

1038


What is the selenese command to show the value of a variable in the log file?

987


How is selenium different from qtp?

880


How many exemptions do you know in selenium webdriver?

936


What is difference between @factory and @dataprovider annotation?

1010