Interview Questions

Selenium WebDriver - How to check the checkbox or radio button is selected ?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - How to check the checkbox or radio button is selected ?

Use isSelected() method to identify. The return type of the method is boolean. So if it return true then button is selected else not enabled.
driver.findElement(By.xpath("xpath of button")).isSelected();
1
driver.findElement(By.xpath("xpath of button")).isSelected();

(Continued on next question...)

Other Interview Questions