How to check checkbox is checked

Hello,
I am using rpa.windows to test my application(WPF) having some checkbox and not able to get checked state of checkbox.
inspect.exe is showing Toggle.ToggleState: On (1) and LegacyIAccessible.DefaultAction: “Uncheck”
are changing but not able to get these properties from RPA.Windows.List Attributes
is there any other way to handle this.

Hello,

You’re right, there isn’t a direct keyword in RPA.Windows to access the toggle state of a checkbox. However, there are alternative approaches to check the state of a checkbox in your WPF application using RPA.Windows:

Method 1: Using Click Keyword with Verification

Click the Checkbox: Use the Click keyword from RPA.Windows to click on the checkbox element you want to check its state.
Verify Text Property: After clicking, use the Get Text keyword to retrieve the text property of the checkbox element.
If the text property indicates a “checked” state (e.g., “On”, “Selected”), then the checkbox is checked.
If the text property indicates an “unchecked” state (e.g., “Off”, “Unselected”), then the checkbox is not checked.

${checkbox_element}  =  Get Element  identifier=your_checkbox_identifier
Click  ${checkbox_element}
${checkbox_text}  =  Get Text  ${checkbox_element}
Run Keyword If  "${checkbox_text}" == "On"  Log To Console  Checkbox is checked 
ELSE  Log To Console  Checkbox is not checked