Skip to content

feat(windows): add Get Checkbox State keyword for toggle state detection#1320

Merged
mikahanninen merged 22 commits into
masterfrom
feature/windows-get-checkbox-state
May 3, 2026
Merged

feat(windows): add Get Checkbox State keyword for toggle state detection#1320
mikahanninen merged 22 commits into
masterfrom
feature/windows-get-checkbox-state

Conversation

@mikahanninen

@mikahanninen mikahanninen commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

feat: Get Checkbox State (closes #1166)

  • New Get Checkbox State keyword in RPA.Windows
  • Uses UIAutomation TogglePattern to read checkbox state
  • Returns True (checked), False (unchecked), or None (indeterminate/tri-state)
  • Raises ActionNotPossible if the element doesn't support the toggle pattern

fix: path: locator timeout (closes #1125)

  • _get_control_from_path() was ignoring the active timeout parameter
  • Path traversal now reads the active UIAutomation timeout and retries each step until the deadline, matching the behaviour of all other locator strategies

feat: test fixture app (packages/windows/resources/testapp.py)

  • Self-contained tkinter GUI with all control types needed by the test suite
  • Tabs: Basic Controls (buttons, checkboxes, radio buttons), Input Controls (entry, combobox, slider, spinbox), List & Table (listbox, treeview), Dynamic Controls (delayed elements for timeout testing)
  • New Robot Framework test cases for: checkboxes, radio buttons, text entry, combobox, path locator timeout

Test plan

  • Test App Checkboxes — verify True/False/None for each checkbox state
  • Test App Radio Buttons — verify Is Selected returns correct values
  • Test App Text Entry — set and get value from the entry field
  • Test App Combobox — select Banana, verify Get Value returns Banana
  • Test App Path Locator Timeout — delayed element found within 5s, not within 0.5s
  • Manually test path: locator with timeout=2 on a non-existing path — confirm raises within ~2s

mikahanninen and others added 2 commits March 9, 2026 14:47
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>
@cursor

cursor Bot commented Mar 9, 2026

Copy link
Copy Markdown

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.

mikahanninen and others added 20 commits March 9, 2026 15:01
_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>
@mikahanninen mikahanninen merged commit fe80c2f into master May 3, 2026
20 checks passed
@mikahanninen mikahanninen deleted the feature/windows-get-checkbox-state branch May 3, 2026 09:41
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

Successfully merging this pull request may close these issues.

RPA.Windows - Ability to check toggle state of Checkbox Timeout value has no effect on path locator strategy

1 participant