Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPA.Windows - Ability to check toggle state of Checkbox #1166

Open
savitakul opened this issue Mar 27, 2024 · 3 comments
Open

RPA.Windows - Ability to check toggle state of Checkbox #1166

savitakul opened this issue Mar 27, 2024 · 3 comments

Comments

@savitakul
Copy link

savitakul commented Mar 27, 2024

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?

@mikahanninen
Copy link
Member

Yes, that can be done. I will add related functionality to the library.

@KamilSoko
Copy link

KamilSoko commented Apr 17, 2024

Hi,

you can always define such keyword in custom library like this:

  1. custom_lib.py
@keyword
def get_checkbox_state_py(checkbox_control: CheckBoxControl) -> bool:
    toggle = checkbox_control.GetTogglePattern()
    return toggle.ToggleState
  1. 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}

@MoonOnHead
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants