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 SelectSpecificCheckBox {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver dr = new FirefoxDriver();
dr.get("http://www.ironspider.ca/forms/checkradio.htm");
List<WebElement> CheckBoxList = dr.findElements(By.name("color"));
// Click on the first check box
CheckBoxList.get(0).click();
// Click on the second check box
CheckBoxList.get(1).click();
// Click on the third check box
CheckBoxList.get(2).click();
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class SelectSpecificCheckBox {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver dr = new FirefoxDriver();
dr.get("http://www.ironspider.ca/forms/checkradio.htm");
List<WebElement> CheckBoxList = dr.findElements(By.name("color"));
// Click on the first check box
CheckBoxList.get(0).click();
// Click on the second check box
CheckBoxList.get(1).click();
// Click on the third check box
CheckBoxList.get(2).click();
}
}
No comments:
Post a Comment