Skip to content

feat: Proxy commands issues via RemoteWebElement #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 3, 2025

Conversation

pujagani
Copy link
Contributor

@pujagani pujagani commented Jul 1, 2025

Fixes #2239

Change list

  • Add mechanism to proxy RemoteWebElement methods.

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • 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

Commands called on WebElements instances are not proxied when using createProxy. Since all webdriver calls route through RemoteWebDriver's execute method, which is marked protected, that call is not intercepted. Commands like findElement return a WebElement instance, and when commands like click are called on it, there is no way to intercept them.

The changes in this PR address the issue by creating a proxy for the RemoteWebElement and assigning id and parent properties for calls whose result is an instance of RemoteWebElement, thereby intercepting these calls without requiring code changes from the user's end.

@mykola-mokhnach
Copy link
Contributor

I believe it's a new feature, not a fix

@mykola-mokhnach mykola-mokhnach changed the title fix: Proxy commands issues via RemoteWebElement feat: Proxy commands issues via RemoteWebElement Jul 2, 2025
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work @pujagani

@pujagani
Copy link
Contributor Author

pujagani commented Jul 3, 2025

@valfirst I made the changes, let me know if it looks alright now.

@valfirst valfirst merged commit 09b7ac2 into appium:master Jul 3, 2025
7 checks passed
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.

bug: unable to intercept click action using appium proxy
3 participants