Webdriver driver=new FirefoxDriver();
driver.get("https://www.flipkart.com/");
List<WebElement>alllinks=driver.findElements(By.xpath("//a"));
int linkcount=alllinks.size();
for(int i=0;i<alllinks.size();i++){
String linkname=alllinks.get(i).getText();
System.out.println(linkname);
}
0 comments:
Post a Comment