Skip to content
PitestsCLI & tooling

Verify AX error handling for select_range on non-text element

Session from pi-computer-use-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

17ssession
0interventions
GOAL

Confirm that calling select_range on a non-text AXMenuButton element in TextEdit produces a clean, expected error message rather than a crash or silent failure.

  1. Prompt · +0
    Screenshot TextEdit, then call select_range on @e2 (a menu button, not a text input) and confirm it fails cleanly with the AXSelectedTextRange error, quoting it verbatim.
  2. Agent did · +0m
    Took a screenshot of TextEdit and captured the semantic window state, identifying @e2 as an AXMenuButton distinct from the AXTextArea @e1.
  3. Agent did · +0m
    Called select_range on @e2, which correctly errored out with 'AXSelectedTextRange not settable', matching the expected failure mode.
  4. Outcome · +0m
    Confirmed the exact error message: 'Element does not support selecting a text range (AXSelectedTextRange not settable). Use set_text for full replacement, or focus the element with click first.'
VERDICT

I'd start with the exact same setup next time — asking it to quote the verbatim error is what made this useful as a test, rather than just checking pass/fail. No correction was needed here since the agent behaved exactly as expected on the first try.

I tried this · 0

Discussion · 0

How Builds work