Showing posts with label Extract Link Size in selenium. Show all posts
Showing posts with label Extract Link Size in selenium. Show all posts

Monday, 17 November 2014

How to Extract Link Size from a website

package com.snapdeal;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class ExtrackLinkSize {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver driver = new FirefoxDriver();
driver.get(“http://seleniumguru.in/”);
List<WebElement> list = driver.findElements(By.tagName(“a”));
System.out.println(“Link size is :” + list.size());
driver.close();
}
}