user14826807
user14826807

Reputation:

checkbox status Selenium

does maybe someone know how to handle or read out the status (true/false) of a checkbox with selenium, when there isn't any variable which toggles on the html page. I already tried the common functions .isSelected() and .isEnabled(), but these read out just the value which isn't available.

Do anyone know if there is a way to get this status ? In Addition a screenshot of the xml and which element it is.

Would be great if someone has an idea. I'm programming in Java.

Code in addition

Upvotes: 0

Views: 44

Answers (1)

JaSON
JaSON

Reputation: 4869

You're trying to get "selected" state from label while isSelected method should only be applied to input of type "checkbox" element. So make sure to select correct element:

driver.findElement(By.id("checkbox_filter_details_text_1_1")).isSelected();

Upvotes: 0

Related Questions