or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

browser-configuration.mddriver-information.mdindex.mdservice-management.mdwebdriver-implementation.md
tile.json

tessl/maven-org-seleniumhq-selenium--selenium-chrome-driver

Selenium Chrome WebDriver implementation for automating Chrome browsers using the WebDriver protocol

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/org.seleniumhq.selenium/selenium-chrome-driver@3.141.x

To install, run

npx @tessl/cli install tessl/maven-org-seleniumhq-selenium--selenium-chrome-driver@3.141.0

index.mddocs/

Selenium Chrome Driver

Selenium Chrome WebDriver implementation for automating Chrome browsers using the WebDriver protocol. Provides Java bindings for Chrome-specific capabilities, service management, and driver lifecycle operations with extensive configuration options for headless operation, extension management, and mobile device emulation.

Package Information

  • Package Name: selenium-chrome-driver
  • Package Type: maven
  • Language: Java
  • Installation:
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-chrome-driver</artifactId>
        <version>3.141.59</version>
    </dependency>

Core Imports

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.chrome.ChromeDriverService;

Basic Usage

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.WebDriver;

// Basic Chrome driver with default configuration
WebDriver driver = new ChromeDriver();

// With Chrome-specific options
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
options.addArguments("--no-sandbox", "--disable-dev-shm-usage");
options.addExtensions(new File("/path/to/extension.crx"));

WebDriver driver = new ChromeDriver(options);

// Navigate and interact
driver.get("https://example.com");
System.out.println(driver.getTitle());
driver.quit();

Architecture

The Chrome Driver is built around several key components:

  • ChromeDriver: Main WebDriver implementation extending RemoteWebDriver with Chrome-specific functionality
  • ChromeOptions: Configuration class for Chrome browser settings, arguments, and extensions
  • ChromeDriverService: Service management for ChromeDriver server lifecycle and configuration
  • ChromeDriverInfo: Metadata provider for Chrome WebDriver capabilities and availability
  • Command Execution: Chrome-specific WebDriver protocol commands and HTTP communication

Capabilities

WebDriver Implementation

Core Chrome WebDriver functionality providing browser automation, navigation, element interaction, and session management.

public class ChromeDriver extends RemoteWebDriver 
    implements LocationContext, WebStorage, HasTouchScreen, NetworkConnection {
    
    public ChromeDriver();
    public ChromeDriver(ChromeDriverService service);
    public ChromeDriver(ChromeOptions options);  
    public ChromeDriver(ChromeDriverService service, ChromeOptions options);
    
    public void launchApp(String id);
    public LocalStorage getLocalStorage();
    public SessionStorage getSessionStorage();
    public Location location();
    public void setLocation(Location location);
    public TouchScreen getTouch();
    public ConnectionType getNetworkConnection();
    public ConnectionType setNetworkConnection(ConnectionType type);
}

WebDriver Implementation

Browser Configuration

Chrome-specific browser configuration including binary paths, command-line arguments, extensions, experimental options, and capability settings.

public class ChromeOptions extends MutableCapabilities {
    public static final String CAPABILITY = "goog:chromeOptions";
    
    public ChromeOptions();
    public ChromeOptions setBinary(String path);
    public ChromeOptions addArguments(String... arguments);
    public ChromeOptions addExtensions(File... paths);
    public ChromeOptions setHeadless(boolean headless);
    public ChromeOptions setExperimentalOption(String name, Object value);
    public ChromeOptions setPageLoadStrategy(PageLoadStrategy strategy);
    public ChromeOptions setAcceptInsecureCerts(boolean acceptInsecureCerts);
    public ChromeOptions setProxy(Proxy proxy);
}

Browser Configuration

Service Management

ChromeDriver server lifecycle management with port configuration, logging options, and process control for distributed testing scenarios.

public class ChromeDriverService extends DriverService {
    public static final String CHROME_DRIVER_EXE_PROPERTY = "webdriver.chrome.driver";
    public static final String CHROME_DRIVER_LOG_PROPERTY = "webdriver.chrome.logfile";
    
    public static ChromeDriverService createDefaultService();
    
    public static class Builder extends DriverService.Builder<ChromeDriverService, ChromeDriverService.Builder> {
        public Builder usingDriverExecutable(File file);
        public Builder usingPort(int port);
        public Builder usingAnyFreePort();
        public Builder withLogFile(File logFile);
        public Builder withEnvironment(Map<String, String> environment);
        public Builder withVerbose(boolean verbose);
        public Builder withSilent(boolean silent);
        public Builder withWhitelistedIps(String whitelistedIps);
    }
}

Service Management

Driver Information

WebDriver metadata and capability detection for automated driver selection and session creation in multi-browser testing environments.

public class ChromeDriverInfo implements WebDriverInfo {
    public String getDisplayName();
    public Capabilities getCanonicalCapabilities();  
    public boolean isSupporting(Capabilities capabilities);
    public boolean isAvailable();
    public int getMaximumSimultaneousSessions();
    public Optional<WebDriver> createDriver(Capabilities capabilities);
}

Driver Information

Types

// Core WebDriver interfaces implemented by ChromeDriver
interface WebDriver {
    void get(String url);
    String getTitle();
    void quit();
    // ... other WebDriver methods
}

interface LocationContext {
    Location location();
    void setLocation(Location location);
}

interface WebStorage {
    LocalStorage getLocalStorage();
    SessionStorage getSessionStorage();
}

interface HasTouchScreen {
    TouchScreen getTouch();
}

interface NetworkConnection {
    ConnectionType getNetworkConnection();
    ConnectionType setNetworkConnection(ConnectionType type);
}

// Configuration types
enum PageLoadStrategy {
    NORMAL, EAGER, NONE
}

enum UnexpectedAlertBehaviour {
    ACCEPT, DISMISS, IGNORE
}

class Proxy {
    // Proxy configuration methods
}