feat(windows): add Get Checkbox State keyword for toggle state detection#1320
Merged
Conversation
Add new `Get Checkbox State` keyword to RPA.Windows that uses the UIAutomation TogglePattern to return True (checked), False (unchecked), or None (indeterminate) for checkbox controls. Closes #1166. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
The IS_WINDOWS guard around ToggleState comparisons caused fall-through to ActionNotPossible with a misleading error on non-Windows. Since auto.ToggleState is already guarded at import time, the check is redundant and the indeterminate None return path was unreachable. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on April 18. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
_get_control_from_path() was ignoring the active UIAutomation timeout when traversing path steps, raising ElementNotFound immediately if a child wasn't present. Now it reads the active timeout (set by @with_timeout via SetGlobalSearchTimeout) and retries each step until the deadline, matching the behaviour of all other locator strategies. Closes #1125. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Add packages/windows/resources/testapp.py — a self-contained tkinter GUI covering buttons, checkboxes (checked/unchecked/indeterminate), radio buttons, text entry, combobox, slider, spinbox, listbox, treeview and a dynamic element panel for timeout testing. Add corresponding Robot Framework test cases: - Test App Checkboxes (exercises Get Checkbox State / #1166) - Test App Radio Buttons - Test App Text Entry - Test App Combobox - Test App Slider - Test App Path Locator Timeout (exercises path: timeout fix / #1125) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
- Replace POSIX-only 'Send Signal To Process group=${True}' with
'Terminate Process' which works on Windows
- Fix text entry locator to use type:EditControl within the LabelFrame
group instead of the adjacent label name
- Fix combobox test to locate by current value ("Apple") and verify
with Get Value instead of checking status bar via widget path name
- Fix slider test to use type:SliderControl within the Slider group
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
…r test manual
- Remove \${EXE_TESTAPP} which used two cells in a scalar variable
definition — this is a parse error in Robot Framework 5
- Mark Test App Slider as manual since ttk.Scale UIAutomation name
needs verification with Accessibility Insights on Windows
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
tkinter widgets do not expose UIAutomation accessibility attributes (all controls appear as unnamed PaneControl), making them unusable for RPA.Windows keyword testing. - Add testapp_wx.py: wxPython equivalent of testapp.py using native Win32 controls that properly expose CheckBoxControl + TogglePattern, ButtonControl, and TextControl via UIAutomation - Add Test App WX Checkboxes: automated test for Get Checkbox State against all three toggle states (True / False / None) - Add Test App WX Path Locator Timeout: automated test for the path: locator timeout fix (issue #1125) using wx.CallLater delayed element - Add wxPython>=4.2.0 (win32 only) to dev dependency group - Mark all tkinter testapp tests as manual with explanation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
System python does not have wxPython installed; uv run python uses the venv where it is available via the dev dependency group. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wx.CallLater fires after 3s but UIAutomation may take a moment to pick up the new StaticText control. Add 0.5s sleep post-click and raise the Get Element timeout to 8s to give enough headroom. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wx.StaticText wraps Win32 Static control which UIAutomation skips as non-interactive. A disabled wx.Button is always in the accessibility tree and exposes ButtonControl with Name='DynamicContent'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document single-quote locator parser fix and path: timeout fix in rpaframework-core under the upcoming release section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extend testapp_wx.py with RadioButton/TextCtrl/ComboBox controls and add three automated robot test cases covering the remaining unchecked items in the PR #1320 test plan. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The two test cases that expected single-quoted names NOT to work as delimiters documented the old broken behaviour. Update them to the correct output now that \S*'[^']+' is recognised by the parser. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
feat: Get Checkbox State (closes #1166)
Get Checkbox Statekeyword inRPA.WindowsTogglePatternto read checkbox stateTrue(checked),False(unchecked), orNone(indeterminate/tri-state)ActionNotPossibleif the element doesn't support the toggle patternfix: path: locator timeout (closes #1125)
_get_control_from_path()was ignoring the activetimeoutparameterfeat: test fixture app (
packages/windows/resources/testapp.py)Test plan
Test App Checkboxes— verifyTrue/False/Nonefor each checkbox stateTest App Radio Buttons— verifyIs Selectedreturns correct valuesTest App Text Entry— set and get value from the entry fieldTest App Combobox— select Banana, verify Get Value returns BananaTest App Path Locator Timeout— delayed element found within 5s, not within 0.5spath:locator withtimeout=2on a non-existing path — confirm raises within ~2s