RPA.Windows - Ability to check toggle state of Checkbox
We are using RPA.Windows for desktop automation, we are trying to find ways to get the toggle state of checkbox and act on UI accordingly. We do not find any RPA.Windows keyword that provides this information. Can you please let us know if we can have such keyword for checkbox control?
Yes, that can be done. I will add related functionality to the library.
Hi,
you can always define such keyword in custom library like this:
- custom_lib.py
@keyword
def get_checkbox_state_py(checkbox_control: CheckBoxControl) -> bool:
toggle = checkbox_control.GetTogglePattern()
return toggle.ToggleState
- custom_resource.resource
Get Checkbox State
[Arguments] ${checkbox_locator}
${checkbox_control} = Get Element ${checkbox_locator}
${state} = Get Checkbox State Py ${checkbox_control.item}
RETURN ${state}
I am also looking for this functionality, can you please update once its implemented. @KamilSoko can you please give more details like library references n all
Reading toggle state of a Checkbox in Windows applications using RPA.Windows would be nice.
In the documentation of RPA.Windows the following is_selected keyword with example is presented. Maybe this could be modified to accept CheckBoxControl.
from RPA.Windows import Windows
lib_win = Windows() value = lib_win.is_selected("type:RadioButtonControl name:Apple") print(value)