Skip to content

[java] Add RemoteWebDriver.getClientFactory() and move HttpCommandExecutor field removal to 4.53 - #18111

Merged
diemol merged 1 commit into
trunkfrom
java-remote-webdriver-client-factory-getter
Oct 1, 2026
Merged

diemol merged 1 commit into
trunkfrom
java-remote-webdriver-client-factory-getter

Conversation

@diemol

@diemol diemol commented Oct 1, 2026

Copy link
Copy Markdown
Member

🔗 Related Issues

Follow-up to #18038, #18047 and #18098. Needed by appium/java-client#2458.

💥 What does this PR do?

  • Adds protected HttpClient.Factory getClientFactory() to RemoteWebDriver. Subclasses, like Appium's AppiumDriver, can use it to create their own HTTP and WebSocket clients. Then they don't need the deprecated HttpCommandExecutor fields.
  • Moves the removal of HttpCommandExecutor.client (public access) and httpClientFactory from 4.52 to 4.53. This gives Appium time to switch to the new getter.

🔧 Implementation Notes

  • getClientConfig() is already public, so only the factory was missing.
  • When tracing is on, the getter returns the traced factory, so new clients are traced too.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s): Claude Code
    • What was generated: the change, the unit test and this description
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

Java only. No other bindings are affected.

🔄 Types of changes

  • New feature (non-breaking change which adds functionality and tests!)

🤖 Generated with Claude Code

…cutor field removal to 4.53

Subclasses like Appium's AppiumDriver can use the driver's HTTP client
factory to create their own clients, instead of relying on the deprecated
HttpCommandExecutor fields. Moving the removal of those fields to 4.53
gives Appium time to switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@selenium-ci selenium-ci added the C-java Java Bindings label Oct 1, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Expose RemoteWebDriver's HTTP client factory to subclasses

✨ Enhancement 📝 Documentation 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Expose the driver's HTTP client factory so subclasses can create clients without deprecated
 executor fields.
• Defer the documented executor field changes to 4.53, giving downstream clients time to migrate.
• Test that the getter returns the factory supplied to the driver.
Diagram

graph TD
  Subclass["Driver subclass"] -->|calls getter| Driver["RemoteWebDriver"] -->|returns| Factory["HTTP client factory"] -->|creates| Client["HTTP or WS client"]
  Subclass -->|gets config| Config["Client config"] -->|passed to factory| Factory
  Driver -->|uses| Executor["HttpCommandExecutor"]
  Subclass -.->|legacy field access| Executor
Loading
High-Level Assessment

Exposing the already-held factory through a protected getter is the smallest change that supports subclasses, including when the factory is tracing-wrapped. Continuing to obtain it from HttpCommandExecutor would preserve the deprecated dependency and would not work reliably with other executor implementations.

Files changed (3) +25 / -2

Enhancement (1) +11 / -0
RemoteWebDriver.javaExpose the driver's HTTP client factory to subclasses +11/-0

Expose the driver's HTTP client factory to subclasses

• Adds a protected 'getClientFactory()' method returning the driver's stored factory. Subclasses can use it with the existing public client configuration; it returns the tracing-wrapped factory when that is what the driver holds.

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Tests (1) +12 / -0
RemoteWebDriverInitializationTest.javaTest factory getter identity +12/-0

Test factory getter identity

• Constructs a driver with a supplied factory and asserts that the getter returns the same instance. The test checks factory identity but does not instantiate a subclass or exercise tracing.

java/test/org/openqa/selenium/remote/RemoteWebDriverInitializationTest.java

Documentation (1) +2 / -2
HttpCommandExecutor.javaDefer documented executor field changes to 4.53 +2/-2

Defer documented executor field changes to 4.53

• Changes the deprecation documentation for 'client' and 'httpClientFactory' from 4.52 to 4.53. This postpones the stated transition for downstream users; the fields themselves are unchanged.

java/src/org/openqa/selenium/remote/HttpCommandExecutor.java

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@diemol
diemol merged commit 93d7472 into trunk Oct 1, 2026
35 checks passed
@diemol
diemol deleted the java-remote-webdriver-client-factory-getter branch October 1, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-java Java Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants