Selenium Java - Handling Form Elements
You wrote this code to select a checkbox:
WebElement cb = driver.findElement(By.id("option1"));
if (cb.isSelected()) {
cb.click();
}
But the checkbox remains unselected after running. What is the error?