Skip to content

Conversation

@mialeska
Copy link
Contributor

+Update DevTools references to use V142

Update DevTools references to use V142
@mialeska mialeska self-assigned this Nov 19, 2025
@mialeska mialeska added enhancement New feature or request dependencies Pull requests that update a dependency file labels Nov 19, 2025
@github-project-automation github-project-automation bot moved this to In progress in Aquality Selenium Nov 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Walkthrough

Updated Maven dependency for aquality-selenium-core from version 4.9.0 to 4.10.0. Systematically upgraded Selenium DevTools imports across source and test files from v140 and v139 to v142 and v141 respectively. Minor API signature adjustments made to NetworkHandling method calls.

Changes

Cohort / File(s) Summary
Dependency Management
pom.xml
Bumped aquality-selenium-core dependency version from 4.9.0 to 4.10.0
DevTools Source Imports
src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java, EmulationHandling.java, JavaScriptHandling.java
Updated Selenium DevTools import package versions from v140 to v142 for Performance, Metric, RGBA, Emulation, MediaFeature, ScreenOrientation, Page, ScriptIdentifier, and Runtime classes
DevTools Network Handling
src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java
Updated imports and documentation references from DevTools v140 to v142; extended Network.enable() method calls with Optional.empty() argument to match v142 API signature
DevTools Test Files
src/test/java/tests/usecases/devtools/DeviceEmulationTest.java, NetworkSpeedEmulationTest.java, OverrideUserAgentTest.java
Updated Selenium DevTools imports from v139 to v141 for Emulation, DisplayFeature, and ConnectionType classes

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • NetworkHandling.java: Review the Optional.empty() argument additions to ensure they align with the v142 API contract and don't alter expected behavior
  • Verify that all DevTools version transitions (v140→v142, v139→v141) are consistent across main and test sources
  • Confirm dependency update to 4.10.0 resolves the updated DevTools versions without conflicts

Possibly related PRs

Suggested labels

java

Poem

🐰 A hop through versions, smooth and clean,
DevTools upgraded, now v142 seen!
From one-forty down to one-forty-two,
Our selenium paths shine bright and new! 🚀

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions updating to Selenium 4.38.0, which aligns with the overall dependency upgrade evident in the changeset (pom.xml update and DevTools version migrations).
Description check ✅ Passed The description directly addresses the main change: updating DevTools references to V142, which is the primary focus of the code modifications across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enhancement/update-to-selenium-4.38.0

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (1)

203-203: v142 getResponseBody usage is correct; you can simplify with the existing static import

Calling tools.sendCommand(org.openqa.selenium.devtools.v142.network.Network.getResponseBody(requestId)) correctly targets the v142 Network API. Given the static import for v142.network.Network.* at the top of the file, you can simplify this line slightly:

-                String responseBody = tools.sendCommand(org.openqa.selenium.devtools.v142.network.Network.getResponseBody(requestId)).getBody();
+                String responseBody = tools.sendCommand(getResponseBody(requestId)).getBody();

This keeps the version in one place (the import) and improves readability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a06c342 and edcaecc.

📒 Files selected for processing (8)
  • pom.xml (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (7 hunks)
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
📚 Learning: 2024-11-29T14:35:07.825Z
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.

Applied to files:

  • src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java
  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java
  • src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java
  • src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java
  • src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java
  • src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java
📚 Learning: 2025-05-28T19:55:33.768Z
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.

Applied to files:

  • src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java
  • src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java
  • src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java
📚 Learning: 2025-07-17T16:29:16.404Z
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 152
File: azure-pipelines.yml:51-63
Timestamp: 2025-07-17T16:29:16.404Z
Learning: Maven3 task in Azure DevOps pipelines was officially deprecated in June 2024. Maven4 is the current supported version that should be used in Azure DevOps pipelines. Maven3 emits warnings and may be removed without further notice.

Applied to files:

  • pom.xml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: aquality-automation.aquality-selenium-java (Run tests)
  • GitHub Check: aquality-automation.aquality-selenium-java (Analyse code with SonarQube)
🔇 Additional comments (9)
src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java (1)

5-8: DevTools Emulation imports bumped to v142 – confirm key method signatures still match

Imports for RGBA, Emulation, MediaFeature, and ScreenOrientation now target v142. The rest of the class (including the 14‑argument Emulation.setDeviceMetricsOverride and setUserAgentOverride calls) is unchanged, so this should be a straight version bump; please just confirm that the v142 signatures still match the existing usages when building against Selenium 4.38.0 / aquality‑selenium‑core 4.10.0. Based on learnings.

src/test/java/tests/usecases/devtools/DeviceEmulationTest.java (1)

6-7: Device emulation tests moved to DevTools v141 – consistent with pattern, verify compile against new APIs

Switching Emulation and DisplayFeature imports to v141 keeps tests slightly behind main code (v142), which matches the project’s prior approach of using custom DevTools versions in tests. Please verify that the Emulation.setDeviceMetricsOverride and DisplayFeature usages still compile cleanly with the v141 API under Selenium 4.38.0. Based on learnings.

src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1)

5-5: ConnectionType import updated to v141 – ensure enum values are unchanged

The ConnectionType import now targets v141, and the existing uses (BLUETOOTH, CELLULAR4G) are unchanged. This looks like a safe mechanical bump; just confirm those enum constants still exist with the same names in the v141 network model. Based on learnings.

src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java (1)

15-17: JavaScript DevTools imports switched to v142 – behavior unchanged if APIs are compatible

Page, ScriptIdentifier, and Runtime now come from v142, while the calling code (removing scripts, adding/removing bindings, enabling runtime) is unchanged. Assuming v142 maintains these methods and parameter shapes, this is a pure version bump; please confirm it compiles and runtime behavior in your JS‑monitoring tests remains the same.

src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (1)

11-11: OverrideUserAgent tests now use Emulation v141 – keep an eye on setUserAgentOverride signature

Pointing Emulation to v141 aligns these tests with the other DevTools test updates while main code uses v142. The direct Emulation.setUserAgentOverride calls (both via sendCommand and CDP command name) should still be valid, but please confirm v141’s setUserAgentOverride parameter list matches your usages (UA, accept‑language, platform, etc.). Based on learnings.

pom.xml (1)

73-73: Core library bumped to 4.10.0 – validate it’s the intended companion for Selenium 4.38.0

Updating aquality-selenium-core to 4.10.0 matches the DevTools v142/v141 migration in this PR. Please confirm that this core version is explicitly built against Selenium 4.38.0 so you don’t get subtle DevTools API mismatches at runtime; a full Maven build plus test run should surface any issues.

src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java (1)

12-13: Performance domain moved to v142 – confirm EnableTimeDomain values are still valid

Performance and Metric now come from v142, while the code still uses Performance.disable(), Performance.enable(Optional.of(EnableTimeDomain.fromString(timeDomain))), and Performance.getMetrics(). This looks correct; just ensure the timeDomain values you pass (timeTicks, threadTicks) are still the allowed values in v142 and that the metrics map returned by getMetrics() hasn’t changed shape.

src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (2)

11-30: Network DevTools moved to v142 – imports and references look coherent

The network model import has been updated to v142.network.model.*, the static import now targets v142.network.Network.*, and the class Javadoc points at the v142 Network class. Given the existing usages (RequestWillBeSent, ResponseReceived, ConnectionType, and the static event factories) are unchanged, this is a consistent version bump; compilation against Selenium 4.38.0 should confirm everything lines up.


133-133: Updated Network.enable(...) calls to new v142 signature – verify that defaulted options are acceptable

The calls to enable(...) in both listeners and both emulateConditions overloads now pass five Optional.empty() arguments, matching the newer v142 Network API shape. That’s a sensible default if you don’t rely on any of the extra configuration knobs; please double‑check the v142 enable Javadoc to ensure that leaving all these parameters empty keeps behavior equivalent to the previous version (e.g., no unintended throttling or buffer limits).

Also applies to: 143-143, 325-325, 342-342

@mialeska mialeska merged commit d71d3aa into master Nov 19, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Aquality Selenium Nov 19, 2025
@mialeska mialeska deleted the enhancement/update-to-selenium-4.38.0 branch November 19, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants