forked from CourseRepository/SeleniumWebdriverWithJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestAllObject.java
More file actions
38 lines (29 loc) · 915 Bytes
/
TestAllObject.java
File metadata and controls
38 lines (29 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package testcase;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
import helper.StartWebDriver;
/**
* @author - rahul.rathore
* @date - 16-Nov-2014
* @project - Webdriver
* @package - testcase
* @file name - TestAllObject.java
*/
public class TestAllObject extends StartWebDriver {
@Test
public void testAll() {
List<WebElement> link = driver.findElements(By.tagName("a"));
for(WebElement ele : link){
System.out.println("Link : " + ele.getText());
System.out.println("href : " + ele.getAttribute("href"));
}
List<WebElement> cla = driver.findElements(By.cssSelector(".txt"));
for(WebElement ele : cla){
System.err.println("id : " + ele.getAttribute("id"));
System.err.println("name : " + ele.getAttribute("name"));
System.err.println("title : " + ele.getAttribute("title"));
}
}
}