Skip to content

Upgrade selenium-java 4.15.0 → 4.46.0 (highest 4.x on Java 11) and unpin it from the Boot 2.6.3 BOM - #205

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785171607-upgrade-selenium-java
Open

Upgrade selenium-java 4.15.0 → 4.46.0 (highest 4.x on Java 11) and unpin it from the Boot 2.6.3 BOM#205
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785171607-upgrade-selenium-java

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Upgrades org.seleniumhq.selenium:selenium-java 4.15.0 → 4.46.0, the highest 4.x line that still targets Java 11, and fixes the classpath split that made the previous "4.15.0" bump cosmetic.

The interesting part is not the version string. On main, the Spring Boot 2.6.3 BOM manages org.seleniumhq.selenium at selenium.version = 3.141.59, so every module that selenium-java pulls in was silently forced back to Selenium 3:

# main (before)
org.seleniumhq.selenium:selenium-java:4.15.0        # only the aggregator was on 4.x
org.seleniumhq.selenium:selenium-api:4.15.0 -> 3.141.59   (Selected by rule)
org.seleniumhq.selenium:selenium-support:4.15.0 -> 3.141.59
org.seleniumhq.selenium:selenium-remote-driver:4.15.0 -> 3.141.59

That is why new WebDriverWait(driver, 10L) compiled — it was resolving against Selenium 3's API. Bumping the coordinate alone reproduces the same split, so this PR also overrides the managed property:

// build.gradle
+ ext['selenium.version'] = '4.46.0'
- testImplementation 'org.seleniumhq.selenium:selenium-java:4.15.0'
+ testImplementation 'org.seleniumhq.selenium:selenium-java:4.46.0'

With the override in place the whole family resolves at 4.46.0 for the first time, which surfaces the one real API break (WebDriverWait(WebDriver, long) was removed in Selenium 4).

Coordinate diff

Coordinate Before (declared → resolved) After (declared → resolved)
org.seleniumhq.selenium:selenium-java 4.15.0 → 4.15.0 4.46.0 → 4.46.0
selenium-api / -support / -remote-driver / -chrome-driver / -edge-driver / -firefox-driver / -ie-driver / -safari-driver (transitive) (managed) → 3.141.59 (managed) → 4.46.0
ext['selenium.version'] not set (BOM default 3.141.59) '4.46.0'

No other dependency lines were touched (webdrivermanager, testng, httpclient5, extentreports unchanged); ext['selenium.version'] only affects org.seleniumhq.selenium artifacts.

Why 4.46.0 (Java 11 ceiling check)

Requirement: highest 4.x that still runs on Java 11 (project is sourceCompatibility = 11, CI is JDK 11, Spring Boot 2.6.3 ceiling).

  • 4.46.0 is the current <release> in selenium-java/maven-metadata.xml (published 2026-07-11, >7 days old, not a pre-release). There is no Selenium 5.x.
  • Java baseline verified from the artifacts, not just the notes: every class in all 18 resolved org.seleniumhq.selenium jars (api, support, remote-driver, http, json, os, manager, chromium/chrome/edge/firefox/ie/safari drivers, devtools v148/v149/v150/latest, java) has class-file major version 55 = Java 11, ignoring META-INF/versions/. A scan of the entire 207-jar testRuntimeClasspath found no class above major 55, so nothing on the classpath requires 17+.
  • Everything below is compiled and run with JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64, which succeeds — the strongest available proof of the Java 11 baseline.
  • Spring Boot stays at 2.6.3; no Boot/dependency-management/DGS changes were needed to fit 4.46.0.

dependencyInsight evidence

./gradlew dependencyInsight --configuration testRuntimeClasspath --dependency org.seleniumhq.selenium (unique resolved coordinates):

org.seleniumhq.selenium:selenium-api:4.46.0
org.seleniumhq.selenium:selenium-api:{prefer 3.141.59} -> 4.46.0
org.seleniumhq.selenium:selenium-chrome-driver:4.46.0
org.seleniumhq.selenium:selenium-chromium-driver:4.46.0
org.seleniumhq.selenium:selenium-devtools-latest:4.46.0
org.seleniumhq.selenium:selenium-devtools-v148:4.46.0
org.seleniumhq.selenium:selenium-devtools-v149:4.46.0
org.seleniumhq.selenium:selenium-devtools-v150:4.46.0
org.seleniumhq.selenium:selenium-edge-driver:4.46.0
org.seleniumhq.selenium:selenium-firefox-driver:4.46.0
org.seleniumhq.selenium:selenium-http:4.46.0
org.seleniumhq.selenium:selenium-ie-driver:4.46.0
org.seleniumhq.selenium:selenium-java:4.46.0
org.seleniumhq.selenium:selenium-json:4.46.0
org.seleniumhq.selenium:selenium-manager:4.46.0
org.seleniumhq.selenium:selenium-os:4.46.0
org.seleniumhq.selenium:selenium-remote-driver:4.46.0
org.seleniumhq.selenium:selenium-safari-driver:4.46.0
org.seleniumhq.selenium:selenium-support:4.46.0

Single version across the family, no conflict-resolution downgrade, no duplicate Selenium versions. The DGS platform's {prefer 3.141.59} constraints now resolve up to 4.46.0 instead of pinning down. Nothing else on testRuntimeClasspath downgraded (HttpClient5 5.2.1, OkHttp/Netty transitives unchanged — Selenium 4.46 uses its own selenium-http + JDK HttpClient by default).

API migration

One source change, exactly the API the new version removed:

// src/test/java/io/spring/selenium/pages/BasePage.java
- protected static final long DEFAULT_TIMEOUT_SECONDS = 10;
- this.wait = new WebDriverWait(driver, DEFAULT_TIMEOUT_SECONDS);
+ protected static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(10);
+ this.wait = new WebDriverWait(driver, DEFAULT_TIMEOUT);

WebDriverWait(WebDriver, long timeOutInSeconds) is a Selenium 3 overload, deprecated and removed in Selenium 4; the Duration constructor replaces it.

Everything else in src/test/java/io/spring/selenium/** needed no changes: ChromeOptions, options.addArguments/setExperimentalOption, ChromeDriver/EdgeDriver/FirefoxDriver, driver.manage().window().maximize()/setSize(Dimension), TakesScreenshot, PageFactory, and ExpectedConditions are all unchanged in 4.46.0. No DesiredCapabilities or getSessionId() usages exist in this repo. Test assertions, @Disabled usage, and coverage/format thresholds were not touched.

Also refreshed the stale Selenium row in .agents/skills/java-engineering-excellence/SKILL.md (it still said 4.15.0) so it records the new version and the ext override.

Verification gate

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 ./gradlew clean test spotlessCheck -x jacocoTestCoverageVerification

baseline (clean main, 3037fa5) this branch
result BUILD SUCCESSFUL BUILD SUCCESSFUL
tests 68 68
failures / errors / skipped 0 / 0 / 0 0 / 0 / 0
spotlessCheck green green

Both numbers aggregated from build/test-results/test/*.xml. Additionally, JAVA_HOME=... ./gradlew compileTestJava compiles the Selenium sources cleanly (it failed with incompatible types: long cannot be converted to Duration before the BasePage migration — the only breakage the upgrade caused). ./gradlew spotlessApply was run before committing.

./gradlew seleniumTest was not run: it needs a live app on the configured base URL plus a real browser/driver, and it is excluded from the test gate by design.

Pre-existing on base, not addressed here

  • jacocoTestCoverageVerification fails on main at ~0.33 instruction coverage against the 0.80 rule in build.gradle. CI excludes it (./gradlew clean test -x jacocoTestCoverageVerification) and so does the gate above. Threshold not lowered, no coverage-padding tests added.
  • The Selenium 3/4 classpath split described above existed on main before this PR; it is fixed here because the upgrade cannot be meaningful without it.
  • Gradle emits Execution optimizations have been disabled for task ':spotlessJava' implicit-dependency warnings and Gradle 8 deprecation warnings on main as well; unchanged by this PR.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/3f6f5574608b44d6bba81bb6b2b0b548
Requested by: @mbatchelor81

Override the Spring Boot 2.6.3 managed selenium.version (3.141.59) so the
selenium modules resolve at 4.46.0 instead of splitting the classpath, and
migrate the removed WebDriverWait(WebDriver, long) overload to Duration.
@mbatchelor81 mbatchelor81 self-assigned this Jul 27, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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