How to know the state of the checkbox (enabled or not) in an EXE application?


I need to identify on a screen of the EXE application, if the checkbox is active or not, because if it is active, I ignore it, otherwise, I must activate it.
Is there a way to do this using the RPA.Windows library in Python?

Best regards.

Hi @luzanilton

Yes, you can do that with our RPA.Windows library, just to keep in mind that this feature isn’t yet fully implemented, but look here for a robot code example on how to do it:

Windows Tick Checkbox
    Control Window    <your window name>
    ${checkbox} =    Get Element    <checkbox name>  # use Accessibility Insights for Windows to detect it
    ${toggle} =    Evaluate    $checkbox.item.GetTogglePattern()
    IF    ${toggle.ToggleState} == ${0}
        Evaluate    $toggle.Toggle()

So the trick is to get the checkbox element, then obtaining its toggle pattern and triggering .Toggle() on it if the checkbox is not checked.

Here’s a recording showcasing it and I already placed a feature request for this. (not sure of any ETA, but at least you got unblocked)

Thank you so much Cosmin.