Selenium Java - Handling Form Elements
You want to verify that a checkbox with id "newsletter" is checked before submitting a form. Which code snippet correctly asserts this using JUnit in Selenium Java?
driver.findElement(By.id("newsletter")) to get the checkbox element.assertTrue() with checkbox.isSelected() to verify it is checked.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions