I am not able to validate toggle switch button is ON or OFF.
I have used “Element Should Be Disabled” & “Element Should Not Be Visible” but these are not working.
That element is just a made to look like toggle button. Value is probably in the attribute “aria-checked”, on selenium most likely you can fetch the value via Get Element Attribute, with browser library, i dont know.
Why “Element Should Be Disabled” doesn’t work ? Because the element is not disabled. Disabled means that the element has “disabled” attribute. It essentially means that the element in question cannot be interacted with. Same with Element should not be visible. Toggling that element does not toggle its visibility, just the “aria-checked” attribute changes (most likely)
In your screenshot you’ve highlighted a \<span> within a \<label>, above the \<label> is a \<input> element, this is the actual field you probably want. You could try with Checkbox Should Be Selected on that \<input> and the other related checkbox keywords
The for attribute on the \<label> will give you the id of the input if it’s dynamic and keeps changing