Skip to content

Conversation

@ikharebashviliGD
Copy link
Owner

Summary

This PR explores an optimized implementation of the isHittable attribute for the /source endpoint, based on reviewer suggestions.

Instead of resolving each element on demand (via queries), I pre-resolve all XCUIElement instances using fb_filterDescendantsWithSnapshots, and then match them back to each snapshot in the hierarchy using their fb_uid.

The goal is to improve performance by avoiding repeated queries during tree traversal, while still exposing accurate runtime XCUIElement.hittable values.


Key Implementation Steps

  • Flattened the snapshot tree using fb_flattenTree
  • Resolved matching XCUIElement instances via fb_filterDescendantsWithSnapshots
  • Mapped snapshot.uid → element
  • Extracted .hittable directly from matched elements
  • Added isHittable to the tree only when not excluded

What observed

In practice, this resolution appears inaccurate in many cases:

  • Elements such as Application, Window, Image, and Other consistently report isHittable: YES
  • This contradicts the runtime behavior observed when using query-based resolution (descendantsMatchingType + matchingIdentifier)
  • Validated this by comparing JSON source outputs side-by-side (attached in main PR)

📎 Related to main discussion: appium#1021
📎 Issue reference: [Feat] - Add isHittable to iOS driver appium#1005

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