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 CheckBoxes {
public static void main(String[] args){
WebDriver dr = new FirefoxDriver();
dr.get("http://www.ironspider.ca/forms/checkradio.htm");
dr.manage().window().maximize();
List<WebElement> CheckBoxList = dr.findElements(By.name("color"));
for(int i =0; i < CheckBoxList.size();i++) {
CheckBoxList.get(i).click();
System.out.println(CheckBoxList.get(i).getAttribute("Value"));
}
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class CheckBoxes {
public static void main(String[] args){
WebDriver dr = new FirefoxDriver();
dr.get("http://www.ironspider.ca/forms/checkradio.htm");
dr.manage().window().maximize();
List<WebElement> CheckBoxList = dr.findElements(By.name("color"));
for(int i =0; i < CheckBoxList.size();i++) {
CheckBoxList.get(i).click();
System.out.println(CheckBoxList.get(i).getAttribute("Value"));
}
}
}
No comments:
Post a Comment