Skip to content

[Bug] SM ignores browser path when version is specified #17540

@titusfortner

Description

@titusfortner

Problem

When invoking Selenium Manager with both --browser-path and --browser-version, if the version of the browser binary at the provided path does not match the requested version, Selenium Manager silently discards the user-provided path and downloads (or uses a cached copy of) the requested version instead. There is no error, no warning, and no log message indicating that the explicitly provided binary is being ignored.

Proposed behavior

  1. Error when --browser-path and --browser-version disagree. The user has given two conflicting inputs and we should not silently pick one.
  2. Provide an escape hatch: support SE_BROWSER_VERSION="ignore" (or equivalent CLI flag) so if a user is setting an environment variable to use a specific browser location it can also override options settings. Just needs to include a clear warning in th elogs this is happening.

Relevant Code

Relevant code: rust/src/lib.rs:525-528 inside discover_local_browser():

  if self.is_browser_version_specific()
      && !self.get_browser_version().eq(&discovered_version)
  {
      download_browser = true;
  }

The version of the binary at --browser-path is detected via general_discover_browser_version() (rust/src/lib.rs:1196-1247), and is_browser_version_specific() (rust/src/lib.rs:817-818) returns
true whenever the requested version contains a . (e.g. 143.0.7499.146, as opposed to channel names like stable/beta). When both conditions hit, download_browser is set to true and the explicit
path is discarded.

Reproducible Code

./selenium-manager \
      --browser chrome \
      --browser-path "/Users/titus/.cache/selenium/chrome/mac-arm64/131.0.6778.264/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing" \
      --browser-version 143.0.7499.146 \
      --debug

Log Output

  [2026-05-22T00:25:23.531Z DEBUG] chromedriver not found in PATH
  [2026-05-22T00:25:23.536Z DEBUG] Running command: /Users/titus/.cache/selenium/chrome/mac-arm64/131.0.6778.264/Google\ Chrome\ for\ Testing.app/Contents/MacOS/Google\ Chrome\ for\ Testing
  --version
  [2026-05-22T00:25:25.212Z DEBUG] Output: "Google Chrome for Testing 131.0.6778.264 "
  [2026-05-22T00:25:25.213Z DEBUG] Detected browser: chrome 131.0.6778.264
  [2026-05-22T00:25:25.213Z DEBUG] Required browser: chrome 143.0.7499.146
...
  [2026-05-22T00:25:25.366Z INFO ] Driver path: /Users/titus/.cache/selenium/chromedriver/mac-arm64/143.0.7499.192/chromedriver
  [2026-05-22T00:25:25.366Z INFO ] Browser path: /Users/titus/.cache/selenium/chrome/mac-arm64/143.0.7499.146/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-managerSelenium ManagerC-rustRust code is mostly Selenium Manager

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions