CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-chromedriver

NPM wrapper for Selenium ChromeDriver that manages binary downloads and provides cross-platform browser automation support

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

ChromeDriver

ChromeDriver is an NPM wrapper for Selenium ChromeDriver that automatically downloads and manages the appropriate ChromeDriver binary for web automation testing. It provides a Node.js interface to interact with ChromeDriver, handles cross-platform installation (macOS, Linux, Windows), and offers extensive configuration options including version management, proxy support, custom download URLs, and automatic Chrome version detection.

Package Information

  • Package Name: chromedriver
  • Package Type: npm
  • Language: JavaScript
  • Installation: npm install chromedriver

Core Imports

const chromedriver = require('chromedriver');

ES modules (via dynamic import):

const chromedriver = await import('chromedriver');

Basic Usage

const chromedriver = require('chromedriver');

// Get path to binary
console.log('ChromeDriver path:', chromedriver.path);
console.log('ChromeDriver version:', chromedriver.version);

// Start ChromeDriver programmatically
chromedriver.start(['--port=9515']);

// Run your Selenium tests here...

// Stop ChromeDriver
chromedriver.stop();

Architecture

ChromeDriver is built around several key components:

  • Binary Management: Automatic download and cross-platform handling of ChromeDriver binaries
  • Process Control: Node.js child process management with start/stop lifecycle
  • Configuration System: Multi-layered configuration through environment variables, package.json, and .npmrc
  • Platform Detection: Intelligent platform and architecture detection for binary selection
  • Version Management: Support for specific versions, latest versions, and Chrome version auto-detection

Capabilities

Process Management

Core functionality for starting and stopping ChromeDriver processes programmatically, with port detection and readiness checking.

/**
 * Start ChromeDriver process with optional arguments
 * @param {string[]} args - Command line arguments for ChromeDriver
 * @param {boolean} returnPromise - If true, returns Promise that resolves when ready
 * @returns {ChildProcess|Promise<ChildProcess>} - Process or Promise resolving to process
 */
function start(args, returnPromise);

/**
 * Stop the running ChromeDriver process
 * @returns {void}
 */
function stop();

Process Management

Binary Information

Access to ChromeDriver binary path, version, and running instance information.

/**
 * Path to the ChromeDriver binary executable
 * @type {string}
 */
const path;

/**
 * Version of the ChromeDriver binary
 * @type {string}
 */
const version;

/**
 * Currently running ChromeDriver process instance
 * @type {ChildProcess|null}
 */
const defaultInstance;

Binary Information

Installation Configuration

Comprehensive configuration system for customizing ChromeDriver installation behavior, including version selection, download sources, and platform-specific options. Configuration is handled through environment variables and npm configuration.

# Environment variable configuration options
CHROMEDRIVER_VERSION=LATEST              # Specific version or 'LATEST'
CHROMEDRIVER_SKIP_DOWNLOAD=true          # Skip binary download
CHROMEDRIVER_FORCE_DOWNLOAD=true         # Force re-download
CHROMEDRIVER_CDNURL=https://example.com  # Custom metadata endpoint
CHROMEDRIVER_CDNBINARIESURL=https://...  # Custom binaries endpoint
CHROMEDRIVER_FILEPATH=/path/to/binary    # Use local file path
DETECT_CHROMEDRIVER_VERSION=true         # Auto-detect from Chrome
INCLUDE_CHROMIUM=true                    # Include Chromium in detection

Installation Configuration

Command Line Interface

Direct execution of ChromeDriver binary through the provided CLI wrapper.

# Direct execution with arguments
chromedriver [arguments]

# Example with port specification
chromedriver --port=9515 --verbose

Command Line Interface

Types

/**
 * Node.js child process instance
 * @typedef {Object} ChildProcess
 * @property {function} kill - Terminate the process
 * @property {Stream} stdout - Standard output stream
 * @property {Stream} stderr - Standard error stream
 * @property {function} on - Event listener registration
 */

/**
 * Platform identifier for ChromeDriver binaries
 * @typedef {'win32'|'win64'|'mac64'|'mac_arm64'|'mac-x64'|'mac-arm64'|'linux64'} PlatformId
 */

Install with Tessl CLI

npx tessl i tessl/npm-chromedriver
Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/chromedriver@140.0.x
Publish Source
CLI
Badge
tessl/npm-chromedriver badge