fix: atomic FindAndClick for ID selectors + SendKeyActions fallback#40
Open
tomkoptel wants to merge 2 commits intodevicelab-dev:mainfrom
Open
fix: atomic FindAndClick for ID selectors + SendKeyActions fallback#40tomkoptel wants to merge 2 commits intodevicelab-dev:mainfrom
tomkoptel wants to merge 2 commits intodevicelab-dev:mainfrom
Conversation
Two fixes for Compose UI compatibility: 1. DeviceLab tapOn: extend FindAndClick atomic path to ID-based selectors (not just text). Previously, ID taps used findElementForTap + Click(x,y) which suffers from stale coordinates when Compose recomposes between the find and click steps. Now ID taps use the same atomic Java call (find node + coordinate click in one round-trip) that text taps use. 2. Both drivers inputText: when SendKeys fails on the active element (stale reference from Compose recomposition after keyboard appears), fall back to SendKeyActions (W3C key press simulation) which doesn't depend on element references. These issues manifest when testing Jetpack Compose UIs where: - Tapping an EditText triggers recomposition (keyboard appears) - The DOM element reference becomes stale before SendKeys executes - Coordinate-based clicks use stale positions after layout shifts
…fallback Cover the two new behaviors: ID-based taps using atomic FindAndClick path, and SendKeys falling back to SendKeyActions on stale element errors. Fix TestInputTextNoSelectorError to account for the new fallback behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
@tomkoptel - Thank for such a good feature addition. We ll review and merge it |
Author
|
@omnarayan you are welcome 🤗 Please, do a review. I was playing with a tool and had issues with Compose UI written app. I've used Claude Opus to investigate an issue. The fix came from LLM, so this one is definitely needs to be reviewed carefully. Cheers! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes for Compose UI compatibility:
DeviceLab tapOn: extend FindAndClick atomic path to ID-based selectors (not just text). Previously, ID taps used findElementForTap + Click(x,y) which suffers from stale coordinates when Compose recomposes between the find and click steps. Now ID taps use the same atomic Java call (find node + coordinate click in one round-trip) that text taps use.
Both drivers inputText: when SendKeys fails on the active element (stale reference from Compose recomposition after keyboard appears), fall back to SendKeyActions (W3C key press simulation) which doesn't depend on element references.
These issues manifest when testing Jetpack Compose UIs where:
Type of Change
Changes Made
- TestInputTextSendKeysFallbackToSendKeyActions — same fallback scenario
- TestInputTextSendKeysFallbackAlsoFails — same both-fail scenario
Related Issues
Fixes #(issue number)
Testing
make test)make lint)Checklist