I want to identify if this button is set to YES or No, then do the following actions.
If YES > switch button to NO
If NO > do nothing.
I tried get text and get attribute but neither work with this particular onoff switch. How can I capture this data? I have attached the respective code fore reference.
As your switch is a html tag and not an image, you can check for the attribute(Get attribute activity) of the html tag that gets changed when you turn on/off.
Before that use UiExplorer or Browser inspector to see what value in the html tag gets changed.
Note: Based on the screenshot, I think its the class name which gets changed when you turn on or off. But can’t confirm without inspecting.
You could also use Get OCR Text to get if it is showing YES or NO… But only if no attributes can be used to determine the value chosen there (angular driven websites can be a pain)…
@eonofrey If the Problem is not Solved yet, Can you please post the Screenshot of the Selector in UiExplorer using a Click Activity , In that way We may Identify an Attribute that can get you the Value.
@eonofrey I cannot find any attribute which can tell us the State of the Button , I guess you need to use Get OCR Text and Find out if it is Able to Extract the Value.
@eonofrey
compared with other onoffswitch implementation we can excpect with higher proabability the yes/no toggled info on the input(check) html element.
Please share this info as requested above with us. Thanks
@eonofrey
have a check on get attribute on the checked attribute (the input element). this schould toogle similar to on off (see my post from above with highlighted screenshot)