{"id":41943,"library":"selenium-webdriver","title":"Selenium WebDriver","description":"Selenium automates browsers for testing and web-based task automation. This is the official JavaScript/Node.js binding for Selenium WebDriver, version 4.44.0. It supports Chrome, Firefox, Safari, and Edge, with automatic driver management via Selenium Manager since v4.6. Releases follow Node.js LTS/Current schedule. Key differentiator: direct browser automation for end-to-end testing, unlike Playwright or Puppeteer which use DevTools Protocol; Selenium uses WebDriver W3C standard for cross-browser compatibility.","status":"active","version":"4.44.0","language":"javascript","source_language":"en","source_url":"https://github.com/SeleniumHQ/selenium","tags":["javascript","automation","selenium","testing","webdriver","webdriverjs"],"install":[{"cmd":"npm install selenium-webdriver","lang":"bash","label":"npm"},{"cmd":"yarn add selenium-webdriver","lang":"bash","label":"yarn"},{"cmd":"pnpm add selenium-webdriver","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"WebSocket support for browser connections (BiDi protocol)","package":"ws","optional":false},{"reason":"Compression for logs and screenshots","package":"jszip","optional":true}],"imports":[{"note":"Both ESM and CJS work. CJS require() is fine, but ESM import is modern.","wrong":"const { Builder } = require('selenium-webdriver')","symbol":"Builder","correct":"import { Builder } from 'selenium-webdriver'"},{"note":"By is exported directly from 'selenium-webdriver' since v4.0.","wrong":"import { By } from 'selenium-webdriver/lib/by'","symbol":"By","correct":"import { By } from 'selenium-webdriver'"},{"note":"until is a plain object, not a module. Direct export since v4.","wrong":"const { until } = require('selenium-webdriver/lib/until')","symbol":"until","correct":"import { until } from 'selenium-webdriver'"},{"note":"Browser-specific options are under 'selenium-webdriver/<browser>' since v4.","wrong":"import { Options } from 'selenium-webdriver/lib/chrome'","symbol":"chrome.Options","correct":"import { Options } from 'selenium-webdriver/chrome'"},{"note":"WebElement is a named export, not default.","wrong":"import WebElement from 'selenium-webdriver'","symbol":"WebElement","correct":"import { WebElement } from 'selenium-webdriver'"}],"quickstart":{"code":"const { Builder, Browser } = require('selenium-webdriver');\n\n(async function example() {\n  let driver = await new Builder().forBrowser(Browser.CHROME).build();\n  try {\n    await driver.get('https://www.selenium.dev');\n    console.log(await driver.getTitle());\n  } finally {\n    await driver.quit();\n  }\n})();","lang":"javascript","description":"Launches Chrome, navigates to selenium.dev, prints the page title, and quits the driver."},"warnings":[{"fix":"Upgrade Node.js to version 20 or later.","message":"Node.js >= 20 required starting from v4.27.0","severity":"breaking","affected_versions":">=4.27.0"},{"fix":"If using By.className with multiple classes, ensure they are separated by spaces.","message":"findElement(By.className(...)) now uses CompoundClassMatcher instead of string match","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Remove custom service configurations; Selenium Manager handles driver binaries automatically.","message":"Builder.setChromeService() and setFirefoxService() are deprecated in favor of Builder.setChromeService() is deprecated; use Selenium Manager.","severity":"deprecated","affected_versions":">=4.6.0"},{"fix":"Do not rely on selenium-webdriver's managed promise. Use native Promises.","message":"PromiseManager is disabled by default since v4.0. Use async/await or .then() explicitly.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Rewrite action chains using actions() API: driver.actions().click(element).perform()","message":"Actions sequences changed in v4: single actions now return 'this' for chaining, not a new sequence.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Manually verify downloaded driver binaries in CI/CD pipelines.","message":"Selenium Manager downloads binaries over HTTPS but does not verify checksums on all platforms (CVE-2023-XXXX). Do not use in untrusted network without verification.","severity":"security","affected_versions":"all"}],"env_vars":null,"search_vec":"'4.44.0':24 'autom':4,13,50,76 'automat':33 'base':11 'bind':19 'browser':5,49,73 'chrome':27 'compat':74 'cross':72 'cross-brows':71 'devtool':63 'differenti':47 'direct':48 'driver':34 'edg':31 'end':53,55 'end-to-end':52 'firefox':28 'follow':42 'javascript':75 'javascript/node.js':18 'key':46 'lts/current':44 'manag':35,38 'node.js':43 'offici':17 'playwright':58 'protocol':64 'puppet':60 'releas':41 'safari':29 'schedul':45 'selenium':1,3,21,37,65,77 'sinc':39 'standard':69 'support':26 'task':12 'test':7,56,78 'unlik':57 'use':62,66 'v4.6':40 'version':23 'via':36 'w3c':68 'web':10 'web-bas':9 'webdriv':2,22,67,79 'webdriverj':80","created_at":"2026-06-04T18:54:51.903595+00:00","updated_at":"2026-06-04T18:54:51.903595+00:00","problems":[{"fix":"Update selenium-webdriver to v4.6+ and ensure SELENIUM_MANAGER environment variable is not set to 'false'.","cause":"Selenium Manager not enabled or outdated; requires internet access to download ChromeDriver.","error":"Error: The ChromeDriver could not be found on the current PATH. Please download ChromeDriver from https://sites.google.com/chromium.org/driver/"},{"cause":"Using a stale or improperly imported driver instance. Common when wrapping driver in another object.","error":"TypeError: driver.findElement is not a function"},{"fix":"Use new API: driver.actions({async: true}).click(element).perform()","cause":"Using old action sequence API (e.g., driver.actions().click(element) incorrectly).","error":"TypeError: actions.click is not a function"},{"fix":"Increase implicit wait: driver.manage().setTimeouts({implicit: 10000}) or use explicit wait with WebDriverWait.","cause":"Element not found within implicit wait timeout.","error":"TimeoutError: Waiting for element to be located failed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/SeleniumHQ/selenium/tree/trunk/javascript/selenium-webdriver#readme","github":"https://github.com/SeleniumHQ/selenium","docs":null,"changelog":null,"pypi":null,"npm":"selenium-webdriver","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}