Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the path for the deepest matching element #116

Merged
merged 1 commit into from
Jan 29, 2014

Conversation

j2bbayle
Copy link
Contributor

We usually want to grab the path for the deepest (leaf) matching object in the tree; this is especially true in iOS 7 since Apple changed the accessibility hierarchy and inserted intermediate views or accessibility elements in between.

Let’s modify -rawAccessibilityPathToElement:favoringSubviews: to search for the deepest matching object instead of return the first the method encounters.

We usually want to grab the path for the deepest (leaf) matching object
in the tree; this is especially true in iOS 7 since Apple changed
the accessibility hierarchy and inserted intermediate views or
accessibility elements in between.

Let’s modify `-rawAccessibilityPathToElement:favoringSubviews:` to
search for the deepest matching object instead of return the first the
method encounters.
@ghost ghost assigned wearhere Jan 28, 2014
@wearhere
Copy link
Contributor

For reference, a case where Subliminal previously failed was in matching links within web views. UIWebView generates a hierarchy of several accessibility elements with the same or similar accessibility information, and from UIAutomation's perspective all of them are valid, but only the leaf element is visible and tappable.

@wearhere
Copy link
Contributor

Elegant fix. Looks good as soon as Travis finishes.

wearhere added a commit that referenced this pull request Jan 29, 2014
Get the path for the deepest matching element
@wearhere wearhere merged commit 0b16b99 into master Jan 29, 2014
@wearhere wearhere deleted the nanouk/search-for-leaf branch January 29, 2014 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants