Repository navigation
Conversation
…enium 4.50 Selenium 4.50 deprecates HttpCommandExecutor.client (public access), httpClientFactory, the factory-based constructors and getAddressOfRemoteServer(). It also deprecates HasBiDi.getBiDi() and maybeGetBiDi() in favour of getHandle(). - Bump Selenium to 4.50.0 and use the new HttpCommandExecutor(HttpClient, Map, URL) constructor. - Keep our own HttpClient.Factory in AppiumCommandExecutor and make getClient() public, so AppiumDriver no longer reads the fields. - Get the server URL from AppiumClientConfig / AppiumDriver.getRemoteAddress(). - Override getHandle(), and keep getBiDi()/maybeGetBiDi() for users since Selenium has no replacement for context-scoped listeners yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… client - Direct connect now switches the target of a SwitchableHttpClient that AppiumCommandExecutor passes to Selenium, instead of replacing the final client field by reflection. The previous client is closed. - For executors that are not AppiumCommandExecutor, AppiumDriver creates its own HTTP client for log websockets (as BiDi already does) and closes it on quit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I am leaving this parked for a while since the current code does not look good. I made a couple of changes in Selenium to improve this PR but I need to wait for 4.51 to be released. If it is ok with you, please leave this PR open and I will come back to it after the next Selenium release. |
|
Thanks @diemol After applying several breaking changes to reduce the amount of shared code java client does not have any more dependencies to any of selenium libs, but selenium-api only (and partially remote-driver) that limits the shared portion to common interfaces without relying on concrete implementations. I believe my recent changes would allow to improve the synergy between teams and focus primarily on the contract rather than implementation details. Preliminary migration guide for the upcoming major release: https://github.com/appium/java-client/blob/master/docs/v10-to-v11-migration-guide.md |
|
@mykola-mokhnach does your comment mean that this PR won't be needed in the future? |
Yes. As of #2462 and #2463, the Java client no longer depends on HttpCommandExecutor or the Selenium HTTP client. It uses selenium-api plus the bridge module, so this PR can be closed. |
Change list
AppiumCommandExecutorkeeps its ownHttpClient.Factoryand uses the newHttpCommandExecutor(HttpClient, Map, URL)constructor.AppiumCommandExecutor.getClient()is now public, soAppiumDriverno longer readsHttpCommandExecutor.client.AppiumClientConfigorAppiumDriver.getRemoteAddress(), not fromgetAddressOfRemoteServer().AppiumDriveroverridesgetHandle(), which is the new way Selenium gives BiDi access.HttpCommandExecutor.client:SwitchableHttpClient) instead of replacing the field. The old client is now closed.HttpCommandExecutor,AppiumDrivercreates its own HTTP client for the log websockets (same as BiDi already does) and closes it onquit().Types of changes
What types of changes are you proposing/introducing to Java client?
Put an
xin the boxes that applyDetails
Selenium 4.50 deprecated some
HttpCommandExecutorfields and methods that Appium uses (SeleniumHQ/selenium#18038, SeleniumHQ/selenium#18098). In Selenium 4.52,clientbecomes protected andhttpClientFactoryis removed. Without this change, Appium would break with Selenium 4.52.Notes:
getBiDi()andmaybeGetBiDi()stay. Selenium deprecated them, but it has no replacement yet for listeners on one browsing context, such asNATIVE_CONTEXT.getAddressOfRemoteServer()is still called only when someone passes their ownHttpCommandExecutor(not Appium's). Selenium has no replacement for that case.🤖 Generated with Claude Code