See @.local/AGENTS.md for additional guidance
Selenium is a Bazel-built monorepo implementing the W3C WebDriver (and related) protocols, shipping multiple language bindings plus Grid and Selenium Manager. The repository README is aimed at contributors; end-user docs live elsewhere.
- Maintain API/ABI compatibility - users upgrade by changing only version number
- Avoid repo-wide refactors/formatting; prefer small, reversible diffs
- The project uses Bazelisk with a hermetic Bazel toolset. Do not run tests or execute Selenium code assuming a language-specific local development environment is configured.
- Rakefile tasks are executed with a bundled jruby wrapped with
go/go.batand frequently used by CI jobs - Prefer targeted Bazel commands; use
bazel query ...to locate labels before build/test
- Use
bazel queryto explore build graph before reading files - Attempt to execute Bazel commands directly. If prevented due to network/toolchain restrictions within the sandbox, fall back to suggesting copy/paste commands for the user on a separate line.
Bindings (see AGENTS.md in each directory for language-specific details):
- Java:
java/ - Python:
py/ - Ruby:
rb/ - JavaScript:
javascript/selenium-webdriver/ - .NET:
dotnet/
Shared/high-risk areas:
rust/(Selenium Manager, seerust/AGENTS.md)common/(build/test wiring; affects multiple areas)common/src/(test HTML fixtures)javascript/atoms/(shared JS atoms; high blast radius)scripts/,rake_tasks/,.github/,Rakefile(tooling/build)third_party/treat as read-onlybazel-*/treat as generated output
The .local/ directory (gitignored) is available for generated artifacts or temporary files:
- Use
--output_base=.local/bazel-outif bazel output directory restricted
When changing user-visible behavior, compare with at least one other binding:
- Example:
rg <term> java/ py/ rb/ dotnet/ javascript/selenium-webdriver/
If behavior is shared/low-level (protocol, serialization, "remote"/transport), suggest follow-up parity work or to file an issue
When implementing solutions prefer writing a test for it first Prefer small (unit) tests over browser tests for speed/reliability Avoid mocks—they can misrepresent API contracts
Useful flags:
--test_size_filters=small(unit tests only)--test_output=all(display console output)--cache_test_results=no(force re-run) See language-specific AGENTS.md for applicable testing usage
Add logging where users may need insight into what's happening See language-specific AGENTS.md for applicable logging usage
This project does not follow semantic versioning (semver); before removing public functionality, mark it as deprecated with a message pointing to the alternative. See language-specific AGENTS.md for applicable deprecation usage
- Comments should explain why, not what - prefer well-named methods over comments
- PRs should focus on one thing; we squash PRs to default
trunkbranch - Prefer copying files to deleting and recreating to maintain git history
- Avoid running
bazel clean --expunge - Run or suggest running
./scripts/format.shor./go all:lintbefore pushing to prevent CI failures
- Everything referenced above as high risk
- WebDriver/BiDi semantics, capability parsing, wire-level behavior
- Dependency updates /
MODULE.bazel/ repin flows - Grid routing/distributor/queue logic
- Call out any high risk areas touched
- Note cross-binding impact and any follow-up issues needed