-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathradioButton.java
More file actions
35 lines (21 loc) · 831 Bytes
/
Copy pathradioButton.java
File metadata and controls
35 lines (21 loc) · 831 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
package main.webdriver;
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 radioButton {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "\\GecoDriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://html.cita.illinois.edu/nav/form/radio/index.php?example=6");
List<WebElement> radioButton = driver.findElements(By.name("crust"));
System.out.println(radioButton.size());
for (int i=0; i< radioButton.size();i++)
{
System.out.println(radioButton.get(i).getAttribute("value"));
}
driver.close();
}
}