Skip to content

fix: do not trust XCUIElement.lastSnapshot for long-lived elements - #1235

Merged
mykola-mokhnach merged 1 commit into
masterfrom
lookup
Aug 28, 2026
Merged

fix: do not trust XCUIElement.lastSnapshot for long-lived elements#1235
mykola-mokhnach merged 1 commit into
masterfrom
lookup

Conversation

@mykola-mokhnach

Copy link
Copy Markdown

lastSnapshot can be a leftover from an unrelated earlier command (e.g. GET /source) when self is a long-lived element such as the tested application or an FBElementCache entry, silently hiding UI content that appeared since. Use fb_cachedSnapshot, which is backed by XCTest's own self-invalidating snapshot cache, in the class chain snapshot-walk strategy, descendant filtering, and XPath context scoping.

Fixes appium/appium#22672

lastSnapshot can be a leftover from an unrelated earlier command (e.g.
GET /source) when self is a long-lived element such as the tested
application or an FBElementCache entry, silently hiding UI content that
appeared since. Use fb_cachedSnapshot, which is backed by XCTest's own
self-invalidating snapshot cache, in the class chain snapshot-walk
strategy, descendant filtering, and XPath context scoping.

Fixes appium/appium#22672

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mykola-mokhnach
mykola-mokhnach merged commit 57968cc into master Aug 28, 2026
56 of 60 checks passed
@mykola-mokhnach
mykola-mokhnach deleted the lookup branch August 28, 2026 06:16
github-actions Bot pushed a commit that referenced this pull request Aug 28, 2026
## [16.9.1](v16.9.0...v16.9.1) (2026-08-28)

### Bug Fixes

* add missing settings to the exported WDASettings/WDACapabilities types ([#1230](#1230)) ([a9e8203](a9e8203))
* do not trust XCUIElement.lastSnapshot for long-lived elements ([#1235](#1235)) ([57968cc](57968cc))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 16.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

🐞 bug: XCUITestDriver: iOSClassChain: Suffix [x] stopped work

2 participants