tree: 17b38c8a5fa7e27e81e4660f61fc065bba3e7a5c [search]
  1. bin/
  2. test/
  3. BUILD.bazel
  4. index.js
  5. package.json
  6. README.md
  7. version.bzl
javascript/selenium-manager/README.md

@selenium/manager

Selenium Manager discovers the browsers installed on a machine, downloads the matching drivers, and prints the paths back as JSON. It is the component the Selenium bindings already shell out to; this package publishes it on its own so it can be used without installing a binding.

Running it

No install needed:

npx @selenium/manager --browser chrome

Or install it:

npm install @selenium/manager
npx selenium-manager --browser chrome

Pass --help for the full command set.

Platform packages

@selenium/manager carries no binary itself. It declares one optional dependency per platform, and npm installs only the one that matches the machine:

PlatformPackage
Linux x64@selenium/manager-linux-x64
Linux arm64@selenium/manager-linux-arm64
macOS (Intel and Apple Si)@selenium/manager-darwin
Windows (x86, x64, arm64)@selenium/manager-win32-ia32

The architecture in a package name is the binary‘s, not the machine’s, which is why one package answers every Windows platform: that binary is ia32, and Windows runs it on x64 and arm64 as well. macOS needs no suffix because its binary is universal.

Using it from Node

binaryPath() resolves the binary without launching it, for callers that want to run it themselves:

const { binaryPath } = require('@selenium/manager')
const { execFileSync } = require('node:child_process')

execFileSync(binaryPath(), ['--browser', 'chrome', '--output', 'json'])

Setting SE_MANAGER_PATH overrides the resolved path, the same way it does in every Selenium binding.

Usage statistics

Selenium Manager can report anonymous usage statistics. When it is launched through this package (selenium-manager or npx @selenium/manager) they are opt-in: the launcher sets SE_AVOID_STATS=true unless you have set it yourself. Set SE_AVOID_STATS=false, or avoid-stats = false in se-config.toml, to send them. Callers that run binaryPath() themselves make that choice through the same variable.

Links