Skip to content

fix: support Selenium-decorated page elements - #2452

Open
dlowzzxx wants to merge 1 commit into
appium:masterfrom
dlowzzxx:fix/selenium-decorator-2368
Open

dlowzzxx wants to merge 1 commit into
appium:masterfrom
dlowzzxx:fix/selenium-decorator-2368

Conversation

@dlowzzxx

Copy link
Copy Markdown
Contributor

Change list

  • Resolve the corresponding public WebElement method when Appium's intercepted RemoteWebElement method cannot be invoked on a Selenium-decorated interface proxy.
  • Add a regression test that verifies both the underlying click and Selenium's afterClick listener run once.

Types of changes

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

Addresses #2368. Selenium's EventFiringDecorator returns a WebElement interface proxy, while AppiumFieldDecorator intercepts a Method declared by RemoteWebElement. Invoking that Method on the Selenium proxy throws “object is not an instance of declaring class.” The compatible-receiver path remains unchanged, and the fallback invokes the decorated receiver rather than unwrapping it.

Validation on Windows with Temurin 21 and Gradle 9.7.1:

  • The new regression test reproduced the issue before the fix and passed afterward.
  • assemble checkstyleMain and git diff --check passed.
  • Full test ran 92 tests: 91 passed; StorageTest failed connecting to the absent local Appium storage service at 127.0.0.1:4723. The same failure occurs on unchanged master. Excluding it, 91/91 passed.
  • checkstyleTest reports the same five missing-Javadoc errors in two untouched test utility files on unchanged master. The new test has no reported violations.
  • JaCoCo's report finalizer failed with an IsolatedAntBuilder classloader error on this Windows host after the targeted test passed. No mobile-device test was performed.

Codex assisted with implementation and validation.

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.

1 participant