Selenium Java - Handling Form Elements
Analyze the following Selenium Java code:
What will be the output after execution?
WebElement checkbox = driver.findElement(By.name("newsletter"));
if (!checkbox.isSelected()) {
checkbox.click();
}
System.out.println(checkbox.isSelected());What will be the output after execution?
