or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

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

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

Java bindings for Chrome DevTools Protocol v133, enabling advanced browser automation capabilities through Selenium WebDriver.

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

To install, run

npx @tessl/cli install tessl/maven-org-seleniumhq-selenium--selenium-devtools-v133@4.31.0

index.mddocs/

Selenium DevTools v133

Selenium DevTools v133 provides Java bindings for Chrome DevTools Protocol (CDP) version 133, enabling advanced browser automation capabilities through Selenium WebDriver. This package offers comprehensive access to browser debugging and automation features including network monitoring, JavaScript execution control, event handling, logging, and target management.

Package Information

  • Package Name: selenium-devtools-v133
  • Package Type: Maven
  • Language: Java
  • Maven Coordinates: org.seleniumhq.selenium:selenium-devtools-v133:4.31.0
  • Installation: Include as Maven dependency or download from Maven Central

Core Imports

import org.openqa.selenium.devtools.v133.v133Domains;
import org.openqa.selenium.devtools.v133.v133CdpInfo;
import org.openqa.selenium.devtools.DevTools;

Basic Usage

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.v133.v133Domains;

// Create a Chrome WebDriver instance
ChromeDriver driver = new ChromeDriver();

// Get DevTools instance
DevTools devTools = driver.getDevTools();
devTools.createSession();

// Create v133 domains
v133Domains domains = new v133Domains(devTools);

// Access specific domain functionality  
devTools.send(domains.log().enable());

// Listen for log entries
devTools.addListener(domains.log().entryAdded(), logEntry -> {
    System.out.println("Browser log: " + logEntry.getLogEntry().getMessage());
});

// Clean up
devTools.close();
driver.quit();

Architecture

Selenium DevTools v133 is built around several key components:

  • CDP Version Support: Specifically implements Chrome DevTools Protocol version 133
  • Domain-Based API: Organizes functionality into logical domains (Events, JavaScript, Network, Log, Target)
  • Generated Code Integration: Uses generated CDP domain classes from protocol specifications
  • DevTools Bridge: Seamlessly integrates with Selenium's DevTools infrastructure
  • Type Safety: Provides strongly-typed Java interfaces for all CDP operations

Capabilities

Core Setup and Initialization

Central factory and registration classes for setting up CDP v133 support within Selenium WebDriver.

public class v133CdpInfo extends CdpInfo {
    public v133CdpInfo();
}

public class v133Domains implements Domains {
    public v133Domains(DevTools devtools);
    public Events<?, ?> events();
    public Javascript<?, ?> javascript();
    public Network<?, ?> network();
    public Target target();
    public Log log();
}

Event Handling

Monitor browser runtime events, console API calls, and JavaScript exceptions with detailed error information and stack traces.

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

Event Handling

JavaScript Control

Execute custom JavaScript, manage script bindings, and inject scripts that run on new document creation.

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

JavaScript Control

Network Monitoring and Interception

Monitor network activity, intercept requests and responses, handle authentication challenges, and modify network behavior.

public class v133Network extends Network<AuthRequired, RequestPaused> {
    public v133Network(DevTools devTools);
    public Event<RequestPaused> requestPausedEvent();
    public Either<HttpRequest, HttpResponse> createSeMessages(RequestPaused pausedReq);
}

Network Monitoring

Log Management

Monitor and manage browser logs with filtering by level and source, providing real-time access to browser debugging information.

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

Log Management

Target Management

Manage browser contexts, tabs, and debugging sessions with support for multi-target debugging scenarios.

public class v133Target implements org.openqa.selenium.devtools.idealized.target.Target {
    public Command<Void> detachFromTarget(Optional<SessionID> sessionId, Optional<TargetID> targetId);
    public Command<List<org.openqa.selenium.devtools.idealized.target.model.TargetInfo>> getTargets();
    public Command<SessionID> attachToTarget(TargetID targetId);
    public Command<Void> setAutoAttach();
    public Event<TargetID> detached();
}

Target Management

Generated CDP Domain Classes

The package includes generated CDP domain classes based on Chrome DevTools Protocol v133 specifications. These classes are generated at build time from the protocol definition files and provide complete Java bindings for all CDP domains.

Available CDP Domain Packages

// Core browser and page management domains
import org.openqa.selenium.devtools.v133.browser.*;       // Browser-level operations
import org.openqa.selenium.devtools.v133.page.*;          // Page lifecycle and navigation
import org.openqa.selenium.devtools.v133.target.*;        // Target/tab management

// JavaScript runtime and debugging domains  
import org.openqa.selenium.devtools.v133.runtime.*;       // JavaScript runtime control
import org.openqa.selenium.devtools.v133.debugger.*;      // JavaScript debugging
import org.openqa.selenium.devtools.v133.profiler.*;      // JavaScript profiling

// Network and communication domains
import org.openqa.selenium.devtools.v133.network.*;       // Network monitoring
import org.openqa.selenium.devtools.v133.fetch.*;         // Request interception
import org.openqa.selenium.devtools.v133.io.*;            // Input/Output operations

// DOM and rendering domains
import org.openqa.selenium.devtools.v133.dom.*;           // DOM manipulation
import org.openqa.selenium.devtools.v133.domdebugger.*;   // DOM debugging

// Device and environment emulation
import org.openqa.selenium.devtools.v133.emulation.*;     // Device emulation
import org.openqa.selenium.devtools.v133.input.*;         // Input simulation

// Monitoring and diagnostics domains
import org.openqa.selenium.devtools.v133.log.*;           // Browser logging
import org.openqa.selenium.devtools.v133.performance.*;   // Performance monitoring
import org.openqa.selenium.devtools.v133.tracing.*;       // Chrome tracing
import org.openqa.selenium.devtools.v133.security.*;      // Security state

Key Generated Model Classes

Each domain package contains a model subpackage with data types and event structures:

// Runtime domain model classes
import org.openqa.selenium.devtools.v133.runtime.model.ConsoleAPICalled;
import org.openqa.selenium.devtools.v133.runtime.model.ExceptionThrown;
import org.openqa.selenium.devtools.v133.runtime.model.BindingCalled;
import org.openqa.selenium.devtools.v133.runtime.model.RemoteObject;
import org.openqa.selenium.devtools.v133.runtime.model.ExceptionDetails;
import org.openqa.selenium.devtools.v133.runtime.model.StackTrace;
import org.openqa.selenium.devtools.v133.runtime.model.Timestamp;

// Page domain model classes  
import org.openqa.selenium.devtools.v133.page.model.ScriptIdentifier;
import org.openqa.selenium.devtools.v133.page.model.Frame;
import org.openqa.selenium.devtools.v133.page.model.NavigationEntry;

// Network domain model classes
import org.openqa.selenium.devtools.v133.network.model.Request;
import org.openqa.selenium.devtools.v133.network.model.Response;
import org.openqa.selenium.devtools.v133.network.model.LoadingFinished;
import org.openqa.selenium.devtools.v133.network.model.RequestWillBeSent;

// Fetch domain model classes
import org.openqa.selenium.devtools.v133.fetch.model.AuthRequired;
import org.openqa.selenium.devtools.v133.fetch.model.RequestPaused;
import org.openqa.selenium.devtools.v133.fetch.model.AuthChallenge;
import org.openqa.selenium.devtools.v133.fetch.model.AuthChallengeResponse;
import org.openqa.selenium.devtools.v133.fetch.model.HeaderEntry;
import org.openqa.selenium.devtools.v133.fetch.model.RequestPattern;

// Target domain model classes
import org.openqa.selenium.devtools.v133.target.model.TargetInfo;
import org.openqa.selenium.devtools.v133.target.model.SessionID;
import org.openqa.selenium.devtools.v133.target.model.TargetID;
import org.openqa.selenium.devtools.v133.target.model.BrowserContextID;

// Log domain model classes
import org.openqa.selenium.devtools.v133.log.model.LogEntry;

Core DevTools Types

Basic infrastructure types used throughout the DevTools API:

// From org.openqa.selenium.devtools
public interface Command<T> {
    // Represents a DevTools command that returns type T
}

public interface Event<T> {
    // Represents a DevTools event with payload type T
}

public class DevTools {
    // Main DevTools communication interface
    public void createSession();
    public <T> T send(Command<T> command);
    public <T> void addListener(Event<T> event, Consumer<T> listener);
    public void close();
}

// From org.openqa.selenium.internal
public class Either<L, R> {
    public boolean isLeft();
    public boolean isRight();
    public L left();
    public R right();
    public static <L, R> Either<L, R> left(L value);
    public static <L, R> Either<L, R> right(R value);
}

// From org.openqa.selenium
public class UsernameAndPassword {
    public UsernameAndPassword(String username, String password);
    public String username();
    public String password();
}

Dependencies

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-devtools-v133</artifactId>
    <version>4.31.0</version>
</dependency>

Required transitive dependencies:

  • org.seleniumhq.selenium:selenium-java (core Selenium functionality)
  • org.seleniumhq.selenium:selenium-remote-driver (remote WebDriver support)
  • org.seleniumhq.selenium:selenium-support (WebDriver support classes)

Version Compatibility

This package is specifically designed for Chrome DevTools Protocol version 133 and is compatible with:

  • Chrome/Chromium browsers version 133 and related versions
  • Selenium WebDriver 4.31.0 and compatible versions
  • Java 11 or higher