Skip to content

Comments

Update selenium and devtools versions#2592

Open
cgoldberg wants to merge 2 commits intoSeleniumHQ:trunkfrom
cgoldberg:update-selenium-version
Open

Update selenium and devtools versions#2592
cgoldberg wants to merge 2 commits intoSeleniumHQ:trunkfrom
cgoldberg:update-selenium-version

Conversation

@cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented Feb 25, 2026

User description

Description

This PR updates the version of selenium used from 4.38 -> 4.41, and the devtools imports in example code from 142 -> 145.

Ruby's selenium-devtools is at 0.143.0 because that's the latest published version.

#2588 should also be merged to fix the dotnet issues when upgrading to 4.41

Motivation and Context

Python CI tests are failing in CI because they are importing a non-existent devtools version. This should fix that and bring all other examples up to date.

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example updated
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

PR Type

Enhancement


Description

  • Update Selenium WebDriver from 4.38.0 to 4.41.0 across all language examples

  • Update DevTools imports from v142 to v145 in Python and Java examples

  • Update Selenium Server JAR references from 4.38.0 to 4.41.0 in test configurations

  • Update package dependencies in JavaScript, .NET, Kotlin, and Ruby projects


Diagram Walkthrough

flowchart LR
  A["Selenium 4.38.0"] -- "upgrade" --> B["Selenium 4.41.0"]
  C["DevTools v142"] -- "upgrade" --> D["DevTools v145"]
  B --> E["Python Examples"]
  B --> F["Java Examples"]
  B --> G[".NET Examples"]
  B --> H["JavaScript Examples"]
  B --> I["Kotlin Examples"]
  B --> J["Ruby Examples"]
  D --> E
  D --> F
Loading

File Walkthrough

Relevant files
Dependencies
11 files
test_network.py
Update DevTools import from v142 to v145                                 
+1/-1     
conftest.py
Update Selenium Server JAR version references                       
+3/-3     
requirements.txt
Update Selenium package version to 4.41.0                               
+1/-1     
CdpApiTest.java
Update DevTools imports from v142 to v145                               
+3/-3     
NetworkTest.java
Update DevTools imports from v142 to v145                               
+4/-4     
BaseTest.cs
Update Selenium Server JAR version reference                         
+1/-1     
SeleniumDocs.csproj
Update Selenium NuGet package versions to 4.41.0                 
+2/-2     
package.json
Update selenium-webdriver package to 4.41.0                           
+1/-1     
pom.xml
Update Selenium version property to 4.41.0                             
+1/-1     
Gemfile
Update selenium-webdriver gem to 4.41.0                                   
+1/-1     
remote_webdriver_spec.rb
Update Selenium Server JAR version reference                         
+1/-1     

@netlify
Copy link

netlify bot commented Feb 25, 2026

👷 Deploy request for selenium-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 39a6d34

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 25, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 25, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Update devtools dependency for compatibility
Suggestion Impact:The commit updated selenium-devtools from 0.142.0 to 0.143.0, partially following the suggestion to bump the devtools version, though it did not update to the suggested 0.145.0.

code diff:

-gem 'selenium-devtools', '= 0.142.0'
+gem 'selenium-devtools', '= 0.143.0'
 gem 'selenium-webdriver', '= 4.41.0'

Update the selenium-devtools gem from version 0.142.0 to 0.145.0 to match the
updated selenium-webdriver version and ensure compatibility.

examples/ruby/Gemfile [10-11]

-gem 'selenium-devtools', '= 0.142.0'
+gem 'selenium-devtools', '= 0.145.0'
 gem 'selenium-webdriver', '= 4.41.0'

[Suggestion processed]

Suggestion importance[1-10]: 9

__

Why: This suggestion correctly identifies a likely incompatibility between selenium-webdriver and selenium-devtools versions, which could lead to runtime errors, making it a critical fix.

High
High-level
Centralize hardcoded Selenium version strings

The Selenium server JAR filename is hardcoded in multiple test files across
different languages. This should be centralized into a single variable per
language ecosystem to simplify future version updates.

Examples:

examples/python/conftest.py [152]
examples/dotnet/BaseTest.cs [20]

Solution Walkthrough:

Before:

# examples/python/conftest.py
@pytest.fixture(scope="function")
def server_old(request):
    _path = os.path.join(..., "selenium-server-4.41.0.jar")
    # ...

@pytest.fixture(scope="function")
def server():
    _path = os.path.join(..., "selenium-server-4.41.0.jar")
    # ...

# examples/dotnet/BaseTest.cs
public class BaseTest
{
    private const string ServerJarName = "selenium-server-4.41.0.jar";
    // ...
}

After:

# In a central Python config file
SELENIUM_VERSION = "4.41.0"
SELENIUM_SERVER_JAR = f"selenium-server-{SELENIUM_VERSION}.jar"

# examples/python/conftest.py
@pytest.fixture(scope="function")
def server_old(request):
    _path = os.path.join(..., SELENIUM_SERVER_JAR)
    # ...

# In a central .NET config file
public static class Config {
    public const string ServerJarName = "selenium-server-4.41.0.jar";
}

# examples/dotnet/BaseTest.cs
public class BaseTest
{
    private const string ServerJarName = Config.ServerJarName;
    // ...
}
Suggestion importance[1-10]: 7

__

Why: This is a strong suggestion that addresses a clear maintainability issue, as the hardcoded version string is updated in multiple files (conftest.py, BaseTest.cs, remote_webdriver_spec.rb), making future updates unnecessarily complex.

Medium
General
Switch to version-agnostic DevTools imports

Replace version-specific DevTools imports (e.g., v145) with non-versioned,
generic imports to improve long-term maintainability.

examples/java/src/test/java/dev/selenium/bidi/cdp/CdpApiTest.java [19-21]

-import org.openqa.selenium.devtools.v145.browser.Browser;
-import org.openqa.selenium.devtools.v145.network.Network;
-import org.openqa.selenium.devtools.v145.network.model.Headers;
+import org.openqa.selenium.devtools.browser.Browser;
+import org.openqa.selenium.devtools.network.Network;
+import org.openqa.selenium.devtools.network.model.Headers;
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: This is a valid suggestion that improves code maintainability by using generic DevTools imports, which would prevent the need for path updates in future releases.

Low
Use generic devtools import path

Replace the version-specific DevTools import for Headers with the generic,
non-versioned import path to improve long-term maintainability.

examples/python/tests/bidi/cdp/test_network.py [5]

-from selenium.webdriver.common.devtools.v145.network import Headers
+from selenium.webdriver.common.devtools.network import Headers
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: This is a valid suggestion that improves code maintainability by using a generic DevTools import path, which would prevent the need for path updates in future releases.

Low
  • Update

@cgoldberg
Copy link
Member Author

PR Code Suggestions

Almost all of the AI code suggestions are just wrong :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant