Skip to content

fix(ElementNotFound): skip page hints in Appium native context (#5812) - #5813

Open
mirao wants to merge 1 commit into
codeceptjs:4.xfrom
mirao:fix/appium-native-notfound-hints-5812
Open

mirao wants to merge 1 commit into
codeceptjs:4.xfrom
mirao:fix/appium-native-notfound-hints-5812

Conversation

@mirao

@mirao mirao commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #5812

Since #5798, every ElementNotFound runs a page script through the first helper that has executeScript. With Appium in a native app context, UiAutomator2 rejects JavaScript on /execute/sync. That logs ERROR webdriver: Method is not implemented and costs an extra request on every not-found lookup, including retries and lookups inside steps that pass.

collect() now skips the script when the helper reports isWeb === false. Appium updates isWeb in switchToWeb() / switchToNative(), so webview contexts still get hints.

Added a unit test that checks executeScript is not called in native context.

🤖 Generated with Claude Code

…eptjs#5812)

Collecting hints ran JavaScript through executeScript, which UiAutomator2
rejects in native context, logging an ERROR line and adding an extra
request on every not-found lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mirao

mirao commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

I tested the fix in my environment with a production test where originally the bug was reproduced.
No Method is not implemented when running "execute/sync" is logged anymore and the test still passes ✔️ .

Used SW:

  • CodeceptJS 4.2.5
  • Appium 3.1.0
  • webdriverio 9.27.2.

This branch has not been deployed

No deployments
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.

Regression in 4.2.5: Appium (native) ElementNotFound hints send JavaScript to execute/sync on every not-found lookup

1 participant