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.
CodePudding user response:
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();