Principle:SeleniumHQ Selenium Development Environment Setup
| Knowledge Sources | |
|---|---|
| Domains | Developer_Experience, Build_Systems, Toolchain |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Process of preparing a local or cloud-based development environment with the required toolchain for building, testing, and contributing to the Selenium monorepo.
Description
The Selenium monorepo uses Bazel as its primary build system with hermetic toolchain management. Development environment setup involves installing Bazelisk (a Bazel version manager that automatically downloads the correct Bazel version specified in the .bazelversion file) and JDK 17+ (with the JAVA_HOME environment variable set to the JDK location). Three environment options are supported: local installation with platform-specific dependencies, Dev Containers (using a custom Dockerfile from scripts/dev-image/ via VS Code or IntelliJ), and Gitpod (cloud-based IDE with VNC on port 5900 and noVNC on port 7900 for browser testing). The project avoids requiring language-specific local toolchains beyond Bazel and Java, as Bazel manages hermetic toolchains for each language binding.
Usage
Apply this principle before making any code contributions. Choose local setup for maximum control, Dev Containers for consistency, or Gitpod for zero-install cloud development. On Windows, additional tools (MSYS2, Visual Studio Build Tools, long path support) are required. On macOS, Xcode command-line tools are needed, and Apple Silicon Macs require Rosetta configuration via .bazelrc.local.
Theoretical Basis
# Environment Setup Decision Tree
IF has_local_machine AND prefers_control:
-> Local: Install Bazelisk + JDK 17+
-> macOS: xcode-select --install, add Rosetta config to .bazelrc.local
-> Windows: MSYS2 + Visual Studio Build Tools + enable long paths
-> Linux: Standard package manager installs
ELIF wants_consistency:
-> Dev Container: .devcontainer/devcontainer.json
(uses scripts/dev-image/Dockerfile)
ELIF wants_zero_install:
-> Gitpod: .gitpod.yml
(includes VNC on port 5900, noVNC on port 7900)
(auto-configures Bazel repository and disk cache)
ELIF wants_docker_only:
-> Docker Image: scripts/dev-image/Dockerfile
# Verification
bazel --version -> confirms Bazelisk/Bazel installed
javac --version -> confirms JDK (not just JRE) installed