Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:SeleniumHQ Selenium Contributor Development Environment

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

Overview

Multi-language development environment with Bazelisk, JDK 17, Node.js 20, Python 3.10+, .NET 8.0, and Rust toolchain for building and testing the Selenium monorepo.

Description

The Selenium monorepo uses a Bazel-based hermetic build system that manages all language toolchains internally. Contributors do not need to install individual language runtimes manually; Bazelisk handles downloading the correct Bazel version, which in turn provisions the correct JDK, Node.js, Python, .NET, and Rust toolchains. A DevContainer or Gitpod configuration is also available for zero-setup cloud development.

Usage

Use this environment when contributing code to any Selenium binding (Java, Python, Ruby, JavaScript, .NET) or to Selenium Manager (Rust). It is the mandatory prerequisite for running builds, tests, and the formatting pipeline described in the Contributor Development Workflow.

System Requirements

Category Requirement Notes
OS Linux, macOS, or Windows Linux recommended; DevContainer available
Hardware 4+ CPU cores, 8GB+ RAM Bazel builds are memory-intensive
Disk 20GB+ free space Bazel cache, downloaded toolchains, browser binaries
Network Internet access required For initial toolchain and dependency downloads

Dependencies

System Packages

  • `git` >= 2.x
  • `bazelisk` (recommended) or Bazel (version managed by `.bazelversion`)

Language Toolchains (Hermetic via Bazel)

The following are automatically provisioned by Bazel from `MODULE.bazel`. Manual installation is not required:

  • Java: JDK 17 (from `java/version.bzl`: `TOOLS_JAVA_VERSION = "17"`)
  • Node.js: 20.9.0 (from `MODULE.bazel`: `node.toolchain(node_version = "20.9.0")`)
  • Python: 3.10.19, 3.11.14, 3.12.12, 3.13.11, 3.14.1 (from `MODULE.bazel`)
  • .NET: 8.0.203 (from `MODULE.bazel`: `dotnet.toolchain(dotnet_version = "8.0.203")`)
  • Rust: Managed via Cargo.toml (edition = "2021")

Python Dependencies

  • `certifi` >= 2026.1.4
  • `trio` >= 0.31.0, < 1.0
  • `trio-websocket` >= 0.12.2, < 1.0
  • `typing_extensions` >= 4.15.0, < 5.0
  • `urllib3[socks]` >= 2.6.3, < 3.0
  • `websocket-client` >= 1.8.0, < 2.0

Ruby Dependencies

  • Ruby >= 3.2 (from `rb/selenium-webdriver.gemspec`)
  • `rexml` ~> 3.2, >= 3.2.5
  • `rubyzip` >= 1.2.2, < 4.0

.NET Dependencies

  • .NET Standard 2.0 target framework (from `dotnet/selenium-dotnet-version.bzl`)

Credentials

No credentials are required for basic development. The following are optional:

  • `SE_DEBUG`: Set to `true` for verbose logging during development.

Quick Install

# Install Bazelisk (manages Bazel version automatically)
# macOS:
brew install bazelisk

# Linux:
npm install -g @bazel/bazelisk

# Or use the DevContainer (VS Code):
# Open the repo and select "Reopen in Container"

# Build all Java targets:
bazel build //java/...

# Run Java unit tests:
bazel test //java/... --test_size_filters=small --test_output=all

Code Evidence

Java version requirement from `java/version.bzl:1-2`:

SE_VERSION = "4.41.0-SNAPSHOT"
TOOLS_JAVA_VERSION = "17"

Node.js toolchain from `MODULE.bazel:52-53`:

node = use_extension("@rules_nodejs/nodejs:extensions.bzl", "node")
node.toolchain(node_version = "20.9.0")

Python toolchains from `MODULE.bazel:110-117`:

python.toolchain(
    is_default = True,
    python_version = "3.10.19",
)
python.toolchain(python_version = "3.11.14")
python.toolchain(python_version = "3.12.12")
python.toolchain(python_version = "3.13.11")
python.toolchain(python_version = "3.14.1")

.NET toolchain from `MODULE.bazel:97-98`:

dotnet = use_extension("@rules_dotnet/dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "8.0.203")

Python minimum version from `py/pyproject.toml:12`:

requires-python = ">=3.10"

Ruby minimum version from `rb/selenium-webdriver.gemspec`:

s.required_ruby_version = Gem::Requirement.new('>= 3.2')

Common Errors

Error Message Cause Solution
`ERROR: no matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type` Bazel cannot find JDK Ensure Bazelisk is installed; it manages JDK provisioning automatically
`error: package `selenium-manager` ... has no edition` Wrong Rust edition Use `bazel build //rust:selenium-manager`; do not use local cargo directly
`ModuleNotFoundError: No module named 'selenium'` Running Python tests outside Bazel Use `bazel test //py:...` instead of `pytest` directly

Compatibility Notes

  • DevContainer: A `.devcontainer/devcontainer.json` is provided for VS Code remote development with all tools pre-installed.
  • Gitpod: A `.gitpod.yml` is provided for cloud-based development.
  • Windows: Use `go.bat` instead of `./go` for Rakefile wrapper tasks.
  • macOS ARM64: Fully supported via Bazel hermetic toolchains.
  • Hermetic Build: Do not assume local language runtimes are available; always use Bazel commands.

Related Pages

Page Connections

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