Skip to content

fix(navigator): coerce numeric AXValue to text - #119

Merged
conorluddy merged 1 commit into
mainfrom
fix/navigator-numeric-axvalue
Nov 5, 2026
Merged

conorluddy merged 1 commit into
mainfrom
fix/navigator-numeric-axvalue

Conversation

@conorluddy

Copy link
Copy Markdown
Owner

Bug

navigator.py --find-text crashed with a traceback on any screen containing a slider or stepper:

File "navigator.py", line 232, in find_element
    elem_text = (elem.label or "") + " " + (elem.value or "")
TypeError: can only concatenate str (not "float") to str

idb reports AXValue as a number for those controls; the rest of the script assumes text.

Fix

Coerce AXValue to str once, where the accessibility tree is flattened into Elements (navigator.py:172), so every consumer (find_element, exact matching, --expect) sees text.

Verified

  • Live on an iPhone 17 Pro simulator (iOS 27): the screen with sliders that crashed now taps through (Tapped: Button "Area charts" (accessibility press)).
  • pytest tests/: 328 passed.

Sliders and steppers report AXValue as a number, which crashed text
matching with a TypeError traceback on any screen containing one.
@conorluddy
conorluddy merged commit ff20db2 into main Nov 5, 2026
1 check passed
@conorluddy
conorluddy deleted the fix/navigator-numeric-axvalue branch November 5, 2026 08:38
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.

1 participant