SeleniumHQ/selenium · critical · Error

Unable to obtain browser driver. For more informatio

Error message

Unable to obtain browser driver.
        For more information on how to install drivers see
        https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/. ${e}

What it means

Thrown by getBinaryPaths() in driverFinder.js when Selenium Manager fails to return driver/browser paths. It wraps any error thrown by binaryPaths() (which spawns the selenium-manager binary) and appends a troubleshooting URL. The original error is preserved in the `cause` property.

Source

Thrown at javascript/selenium-webdriver/common/driverFinder.js:38

 *
 *  Utility to find if a given file is present and executable.
 */

const path = require('node:path')
const { binaryPaths } = require('./seleniumManager')

/**
 * Determines the path of the correct Selenium Manager binary
 * @param {Capabilities} capabilities browser options to fetch the driver
 * @returns {{browserPath: string, driverPath: string}} path of the driver
 * and browser location
 */
function getBinaryPaths(capabilities) {
  try {
    const args = getArgs(capabilities)
    return binaryPaths(args)
  } catch (e) {
    throw new Error(
      `Unable to obtain browser driver.
        For more information on how to install drivers see
        https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/. ${e}`,
      { cause: e },
    )
  }
}

function getArgs(options) {
  let args = ['--browser', options.getBrowserName(), '--language-binding', 'javascript', '--output', 'json']

  if (options.getBrowserVersion() && options.getBrowserVersion() !== '') {
    args.push('--browser-version', options.getBrowserVersion())
  }

  const vendorOptions =
    options.get('goog:chromeOptions') || options.get('ms:edgeOptions') || options.get('moz:firefoxOptions')
  if (vendorOptions && vendorOptions.binary && vendorOptions.binary !== '') {

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Inspect the error.cause for the specific underlying failure message.
  2. Ensure network/proxy access for driver downloads, or configure proxy via capabilities.getProxy().
  3. Pin a known browser version with capabilities.setBrowserVersion().
  4. Pre-install the driver and pass it via the browser Service (e.g., new chrome.ServiceBuilder(driverPath)).
  5. Install the target browser in the execution environment.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const paths = getBinaryPaths(capabilities)
} catch (e) {
  console.error('Driver setup failed:', e.message)
  if (e.cause) console.error('Underlying cause:', e.cause)
  // fallback: specify driver path manually via Service
}

Prevention

When it happens

Trigger: Selenium Manager cannot download a driver (no network, proxy block); the target browser is not installed; requested browser version has no matching driver; SE_MANAGER_PATH points to a broken binary; the spawned binary exits non-zero or returns unparseable output.

Common situations: First run in a locked-down CI/CD environment; corporate firewall blocking driver downloads; browser auto-updated to a version with no driver yet; running in a minimal Docker image without the browser installed.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/27497b5c39b2f6aa. Report an issue: GitHub.