or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

events.mdindex.mdjavascript.mdlogging.mdnetwork.mdtarget.md
tile.json

tessl/maven-org-seleniumhq-selenium--selenium-devtools-v110

Chrome DevTools Protocol (CDP) bindings for Java - version 110, enabling advanced browser automation features like network interception, console event handling, JavaScript execution, and target management.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/org.seleniumhq.selenium/selenium-devtools-v110@4.9.x

To install, run

npx @tessl/cli install tessl/maven-org-seleniumhq-selenium--selenium-devtools-v110@4.9.0

index.mddocs/

Selenium DevTools v110

Selenium DevTools v110 provides Chrome DevTools Protocol (CDP) bindings specifically for Chrome browser version 110. This package enables Java developers to access advanced browser automation capabilities beyond standard WebDriver functionality, including network monitoring and interception, JavaScript execution and evaluation, console and logging functionality, browser target management, and sophisticated event handling.

Package Information

  • Package Name: selenium-devtools-v110
  • Package Type: Maven
  • Language: Java
  • Group ID: org.seleniumhq.selenium
  • Artifact ID: selenium-devtools-v110
  • Version: 4.9.0
  • Installation:
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-devtools-v110</artifactId>
      <version>4.9.0</version>
    </dependency>

Core Imports

import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.v110.v110Domains;
import org.openqa.selenium.devtools.v110.v110CdpInfo;

For specific domain functionality:

import org.openqa.selenium.devtools.v110.v110Network;
import org.openqa.selenium.devtools.v110.v110Events;
import org.openqa.selenium.devtools.v110.v110Javascript;
import org.openqa.selenium.devtools.v110.v110Log;
import org.openqa.selenium.devtools.v110.v110Target;

Basic Usage

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.v110.v110Domains;
import org.openqa.selenium.devtools.v110.network.Network;

// Create Chrome driver and get DevTools session
ChromeDriver driver = new ChromeDriver();
DevTools devTools = driver.getDevTools();
devTools.createSession();

// Initialize v110 domains
v110Domains domains = new v110Domains(devTools);

// Enable network monitoring
devTools.send(Network.enable(Optional.empty(), Optional.empty(), Optional.empty()));

// Add authentication handler
domains.network().addAuthHandler(
    uri -> uri.contains("secure-site.com"),
    new UsernameAndPassword("username", "password")
);

// Listen for console events
domains.events().addConsoleListener(event -> {
    System.out.println("Console: " + event.getMessages());
});

// Navigate and observe network/console activity
driver.get("https://example.com");

Architecture

The v110 package follows Selenium's idealized DevTools API pattern with several key components:

  • CDP Info Service: v110CdpInfo automatically registers the v110 CDP version with Selenium's service discovery
  • Domains Container: v110Domains provides centralized access to all CDP domain implementations
  • Domain Wrappers: High-level Java classes (v110Network, v110Events, etc.) that wrap auto-generated CDP protocol classes
  • Generated CDP Classes: Complete Java bindings for all CDP domains auto-generated from Chrome DevTools Protocol specifications
  • Idealized API: Common interfaces across CDP versions for forward/backward compatibility

Capabilities

Network Monitoring and Interception

Advanced network functionality including request/response interception, authentication handling, user agent modification, and traffic monitoring.

public class v110Network extends Network<AuthRequired, RequestPaused> {
    public v110Network(DevTools devTools);
}

Network Operations

Console and Runtime Events

JavaScript console monitoring, exception tracking, and runtime event handling with full Chrome DevTools integration.

public class v110Events extends Events<ConsoleAPICalled, ExceptionThrown> {
    public v110Events(DevTools devtools);
}

Event Handling

JavaScript Execution and Bindings

JavaScript evaluation, runtime bindings, and script injection capabilities for advanced browser interaction.

public class v110Javascript extends Javascript<ScriptIdentifier, BindingCalled> {
    public v110Javascript(DevTools devtools);
}

JavaScript Operations

Browser Target Management

Target discovery, attachment, and management for working with browser tabs, workers, and other execution contexts.

public class v110Target implements org.openqa.selenium.devtools.idealized.target.Target {
    // Target management methods
}

Target Management

Browser Logging

Access to browser logs including console messages, network logs, and other diagnostic information.

public class v110Log implements org.openqa.selenium.devtools.idealized.log.Log {
    public v110Log();
    Command<Void> enable();
    Command<Void> clear();
    Event<org.openqa.selenium.devtools.idealized.log.model.LogEntry> entryAdded();
}

Logging Operations

CDP Domain Integration

Generated Domain Classes

The package automatically generates complete Java bindings for all CDP v110 domains:

// Runtime domain for JavaScript execution
org.openqa.selenium.devtools.v110.runtime.Runtime

// Network domain for HTTP monitoring
org.openqa.selenium.devtools.v110.network.Network

// Fetch domain for request interception
org.openqa.selenium.devtools.v110.fetch.Fetch

// Page domain for page-level operations
org.openqa.selenium.devtools.v110.page.Page

// Target domain for target management  
org.openqa.selenium.devtools.v110.target.Target

// Log domain for browser logging
org.openqa.selenium.devtools.v110.log.Log

Core DevTools Types

import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;

// DevTools session for sending commands and receiving events
public class DevTools {
    void createSession();
    <T> T send(Command<T> command);
    void addListener(Event<T> event, Consumer<T> listener);
}

// Represents a CDP command
public interface Command<T> {
    String getMethod();
    Map<String, Object> getParams();
}

// Represents a CDP event
public interface Event<T> {
    String getMethod();
}

Error Handling

CDP operations may throw various exceptions that should be handled appropriately:

import org.openqa.selenium.devtools.DevToolsException;
import org.openqa.selenium.JavascriptException;

// General DevTools protocol errors
public class DevToolsException extends RuntimeException {
    // Thrown when CDP commands fail or timeout
}

// JavaScript execution errors  
public class JavascriptException extends RuntimeException {
    // Thrown when JavaScript evaluation fails
}