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 links {
public static void main(String[] args) {
WebDriver d1 = new FirefoxDriver();
d1.get("http://ezeego1.com");
List<WebElement> alllinks=d1.findElements(By.tagName("a"));
System.out.println("Number Of Links On Home Page Are " + "---" + alllinks.size());
WebElement firstlink= alllinks.get(0);
WebElement secondlink= alllinks.get(1);
//System.out.println(firstlink);
for (int i=0; i<alllinks.size();i++){
System.out.println(alllinks.get(i).getText()+"-------"+alllinks.get(i).isDisplayed());
}
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class links {
public static void main(String[] args) {
WebDriver d1 = new FirefoxDriver();
d1.get("http://ezeego1.com");
List<WebElement> alllinks=d1.findElements(By.tagName("a"));
System.out.println("Number Of Links On Home Page Are " + "---" + alllinks.size());
WebElement firstlink= alllinks.get(0);
WebElement secondlink= alllinks.get(1);
//System.out.println(firstlink);
for (int i=0; i<alllinks.size();i++){
System.out.println(alllinks.get(i).getText()+"-------"+alllinks.get(i).isDisplayed());
}
}
}
No comments:
Post a Comment