Selenium: using isSelected()

Last updated on:

One of the case when we use isSelected() is check boxes, here is an example:

WebDriver driver = new FirefoxDriver();

first_checkBox = driver.findElement(By.id("first_checkBox"));
second_checkBox = driver.findElement(By.id("second_checkBox"));

if(first_checkBox.isSelected){
second_ceckBox.click();
}
View Comments

Leave a Comment

Use markdown or basic HTML and be nice.