[KOB-53267] fix(python proxy): inject element id into empty click bodies#64
Open
mimosa767 wants to merge 1 commit into
Open
[KOB-53267] fix(python proxy): inject element id into empty click bodies#64mimosa767 wants to merge 1 commit into
mimosa767 wants to merge 1 commit into
Conversation
Appium-Python-Client 3.x's `element.click()` sends `POST .../element/{eid}/click`
with body `{}`. Java's `MobileElement.click()` sends `{"id":"<eid>"}`.
Kobiton's flex-correct matches live commands against the baseline by the
legacy id-in-body click shape, so Python's empty body breaks the match and
the dropped intermediate commands from KOB-53091 never get replayed
server-side. Save Expense fires on an empty form, the form stays on screen,
and the next UI step can't be found -- every Python pytest export of a
recording that depends on flex-correct fails at the first form-submit.
Intercept `POST .../element/<eid>/click` in `ProxyServer.serve()` and rewrite
empty `{}` bodies to `{"id":"<eid>"}` (eid extracted from the URL path).
Java-shape bodies pass through unchanged.
Verified on baseline session 8671449 (Pixel 8 Pro / Android 16, flex=true):
- Without patch: FAIL @ Open Menu, 135s (session 8672218)
- With patch: PASS, 19s (session 8672365)
Matches Java's 17s pass time.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
element.click()sendsPOST .../element/{eid}/clickwith body{}. Java'sMobileElement.click()sends{"id":"<eid>"}. Kobiton's flex-correct matches live commands against the baseline by the legacy id-in-body click shape, so Python's empty body breaks the match — flex-correct can't replay the dropped intermediate commands from KOB-53091, Save Expense fires on an empty form, and the test fails at the next UI step.POST .../element/<eid>/clickinProxyServer.serve()and rewrites empty{}bodies to{"id":"<eid>"}(extractingeidfrom the URL path). Java-shape bodies pass through unchanged.Verification
All runs on baseline session 8671449, Pixel 8 Pro / Android 16,
kobiton:flexCorrect=true, no live-view portal-watching:{"id":"…"}{}{"id":"…"}Python now performs identically to Java end-to-end on the same baseline.
Test plan
{"id":"<eid>"}via session 8672365's Appium log/elements,/timeouts,/context,/source,/screenshot, etc.) are unaffected — patch only triggers onPOST .../element/<eid>/clickid) pass through unchangedNotes
{}and{"id":"…"}would be the most correct fix — this PR is the contained workaround that ships today and unblocks generated Python pytest exports.🤖 Generated with Claude Code