Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Environment:SeleniumHQ Selenium Selenium Manager Runtime

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Binary_Management, Cross_Platform
Last Updated 2026-02-11 23:00 GMT

Overview

Cross-platform runtime environment for the Selenium Manager binary that automatically downloads and manages browser and driver binaries, requiring a writable cache directory and supporting Windows, macOS, and Linux (x86_64 only).

Description

Selenium Manager is a Rust-compiled binary bundled with the Selenium language bindings. It is extracted from the binding's package at runtime, detects the current platform, and downloads the correct browser and driver binaries as needed. The binary communicates with language bindings via JSON output over subprocess invocation. It supports proxy configuration, mirror URLs, offline mode, and custom cache paths.

Usage

Use this environment for any Selenium WebDriver session that relies on automatic driver management. Selenium Manager is invoked transparently when no driver binary is found on PATH and no explicit driver path is configured. It is the prerequisite for the `SeleniumManager.getBinaryPaths()` implementation.

System Requirements

Category Requirement Notes
OS Windows, macOS, or Linux Linux ARM64 not supported (throws WebDriverException)
Architecture x86_64 (Intel/AMD 64-bit) ARM/aarch64 on Linux raises an error
Disk Writable cache directory Default: `~/.cache/selenium`; falls back to temp directory
Network Internet access (optional) Required for downloading binaries; offline mode available

Dependencies

Runtime Dependencies

  • Selenium language binding: Java, Python, Ruby, JavaScript, or .NET (provides bundled binary)
  • File system: Writable directory for binary cache
  • HTTP client: For downloading browser/driver binaries (built into Selenium Manager)

Rust Build Dependencies (for compiling from source)

  • `clap` = 4.5.48 (CLI argument parsing)
  • `tokio` = 1.47.1 (async runtime)
  • `reqwest` = 0.12.23 (HTTP client)
  • `zip` = 5.1.1, `flate2` = 1.1.2, `tar` = 0.4.44, `bzip2` = 0.6.0, `sevenz-rust` = 0.6.1, `xz2` = 0.1.7 (archive extraction)
  • `serde` = 1.0.228, `serde_json` = 1.0.145 (JSON serialization)
  • `which` = 8.0.0 (binary detection on PATH)
  • `directories` = 6.0.0 (cross-platform directory resolution)

Credentials

The following environment variables control Selenium Manager behavior:

  • `SE_MANAGER_PATH`: Custom path to the Selenium Manager binary (bypasses extraction from JAR).
  • `SE_CACHE_PATH`: Override cache directory (default: `~/.cache/selenium`).
  • `SE_DEBUG`: Enable debug-level logging output.
  • `SE_<CONFIG_KEY>`: Any Selenium Manager configuration key can be set via environment variable with `SE_` prefix (e.g., `SE_BROWSER_VERSION`, `SE_DRIVER_MIRROR_URL`, `SE_PROXY`, `SE_OFFLINE`).

Quick Install

# Selenium Manager is bundled automatically with language bindings.
# No manual installation is needed for end users.

# For development (building from source):
cd rust/
cargo build --release

# Override the Selenium Manager binary:
export SE_MANAGER_PATH=/path/to/custom/selenium-manager

Code Evidence

Platform detection and ARM64 rejection from `java/src/org/openqa/selenium/manager/SeleniumManager.java:191-239`:

Platform current = Platform.getCurrent();
if (current.is(WINDOWS)) {
  folder += "windows";
  file += EXE;
} else if (current.is(MAC)) {
  folder += "macos";
} else if (current.is(LINUX)) {
  folder += "linux";
} else if (current.is(UNIX)) {
  folder += "linux";
}
// ...
if (System.getProperty("os.arch").contains("arm")
    || System.getProperty("os.arch").contains("aarch64")) {
  throw new WebDriverException("Selenium Manager binary not available for ARM64 on Linux");
}

Cache path resolution from `java/src/org/openqa/selenium/manager/SeleniumManager.java:65-68`:

private static final String DEFAULT_CACHE_PATH = "~/.cache/selenium";
private static final String BINARY_PATH_FORMAT = "/manager/%s/%s";
private static final String HOME = "~";
private static final String CACHE_PATH_ENV = "SE_CACHE_PATH";

Environment variable propagation from `java/src/org/openqa/selenium/manager/SeleniumManager.java:71`:

private static final String SE_ENV_PREFIX = "SE_";

Subprocess timeout from `java/src/org/openqa/selenium/manager/SeleniumManager.java:147`:

Duration.ofHours(1)  // 1-hour timeout for Selenium Manager process

Rust configuration keys from `rust/src/config.rs:44`:

pub const ENV_PREFIX: &str = "SE_";

Common Errors

Error Message Cause Solution
`Selenium Manager binary not available for ARM64 on Linux` Running on Linux ARM64/aarch64 Use x86_64 platform or set `SE_MANAGER_PATH` to a custom binary
`Unable to obtain Selenium Manager binary` Cache directory not writable Set `SE_CACHE_PATH` to a writable directory
`Selenium Manager process timed out` Network issues downloading binaries Set `SE_PROXY` for proxy access or use `SE_OFFLINE=true` with pre-cached binaries
`Could not parse Selenium Manager output` Corrupted or incompatible binary Clear cache (`~/.cache/selenium`) and retry

Compatibility Notes

  • Linux ARM64: Not supported. The Java binding throws `WebDriverException` for ARM/aarch64 architectures.
  • macOS: Supports both Intel (x86_64) and Apple Silicon (ARM64) via separate binaries.
  • Windows: Binary has `.exe` extension; extracted from JAR with executable permissions.
  • Offline Mode: Set `SE_OFFLINE=true` to prevent network downloads; requires pre-cached binaries.
  • Custom Mirrors: Use `SE_DRIVER_MIRROR_URL` and `SE_BROWSER_MIRROR_URL` for corporate/air-gapped environments.
  • Timeout: Selenium Manager subprocess has a 1-hour maximum execution timeout.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment