Table of Contents

Class CdpModule

Namespace
Selenium.WebDriver.BiDi.Cdp
Assembly
Selenium.WebDriver.BiDi.Cdp.dll

Provides access to the Chrome DevTools Protocol (CDP) over BiDi.

public class CdpModule : Module
Inheritance
Module
CdpModule
Inherited Members
Module.CreateEventSource<TEventArgs>(EventDescriptor<TEventArgs>)

Properties

Accessibility

[Experimental("BIDICDP001")]
public IAccessibility Accessibility { get; }

Property Value

IAccessibility

Ads

A domain for ad-related metrics and data.

[Experimental("BIDICDP001")]
public IAds Ads { get; }

Property Value

IAds

Animation

[Experimental("BIDICDP001")]
public IAnimation Animation { get; }

Property Value

IAnimation

Audits

Audits domain allows investigation of page violations and possible improvements.

[Experimental("BIDICDP001")]
public IAudits Audits { get; }

Property Value

IAudits

Autofill

Defines commands and events for Autofill.

[Experimental("BIDICDP001")]
public IAutofill Autofill { get; }

Property Value

IAutofill

BackgroundService

Defines events for background web platform features.

[Experimental("BIDICDP001")]
public IBackgroundService BackgroundService { get; }

Property Value

IBackgroundService

BluetoothEmulation

This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.

[Experimental("BIDICDP001")]
public IBluetoothEmulation BluetoothEmulation { get; }

Property Value

IBluetoothEmulation

Browser

The Browser domain defines methods and events for browser managing.

public IBrowser Browser { get; }

Property Value

IBrowser

CSS

This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). A client can also keep track of stylesheets via the styleSheetAdded/styleSheetRemoved events and subsequently load the required stylesheet contents using the getStyleSheetText methods.

[Experimental("BIDICDP001")]
public ICSS CSS { get; }

Property Value

ICSS

CacheStorage

[Experimental("BIDICDP001")]
public ICacheStorage CacheStorage { get; }

Property Value

ICacheStorage

Cast

A domain for interacting with Cast, Presentation API, and Remote Playback API functionalities.

[Experimental("BIDICDP001")]
public ICast Cast { get; }

Property Value

ICast

Console

This domain is deprecated - use Runtime or Log instead.

[Obsolete]
public IConsole Console { get; }

Property Value

IConsole

CrashReportContext

This domain exposes the current state of the CrashReportContext API.

[Experimental("BIDICDP001")]
public ICrashReportContext CrashReportContext { get; }

Property Value

ICrashReportContext

DOM

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client. Note that iframe owner elements will return corresponding document elements as their child nodes.

public IDOM DOM { get; }

Property Value

IDOM

DOMDebugger

DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.

public IDOMDebugger DOMDebugger { get; }

Property Value

IDOMDebugger

DOMSnapshot

This domain facilitates obtaining document snapshots with DOM, layout, and style information.

[Experimental("BIDICDP001")]
public IDOMSnapshot DOMSnapshot { get; }

Property Value

IDOMSnapshot

DOMStorage

Query and modify DOM storage.

[Experimental("BIDICDP001")]
public IDOMStorage DOMStorage { get; }

Property Value

IDOMStorage

Debugger

Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.

public IDebugger Debugger { get; }

Property Value

IDebugger

DeviceAccess

[Experimental("BIDICDP001")]
public IDeviceAccess DeviceAccess { get; }

Property Value

IDeviceAccess

DeviceOrientation

[Experimental("BIDICDP001")]
public IDeviceOrientation DeviceOrientation { get; }

Property Value

IDeviceOrientation

DigitalCredentials

This domain allows interacting with the Digital Credentials API for automation.

[Experimental("BIDICDP001")]
public IDigitalCredentials DigitalCredentials { get; }

Property Value

IDigitalCredentials

Emulation

This domain emulates different environments for the page.

public IEmulation Emulation { get; }

Property Value

IEmulation

EventBreakpoints

EventBreakpoints permits setting JavaScript breakpoints on operations and events occurring in native code invoked from JavaScript. Once breakpoint is hit, it is reported through Debugger domain, similarly to regular breakpoints being hit.

[Experimental("BIDICDP001")]
public IEventBreakpoints EventBreakpoints { get; }

Property Value

IEventBreakpoints

Extensions

Defines commands and events for browser extensions.

[Experimental("BIDICDP001")]
public IExtensions Extensions { get; }

Property Value

IExtensions

FedCm

This domain allows interacting with the FedCM dialog.

[Experimental("BIDICDP001")]
public IFedCm FedCm { get; }

Property Value

IFedCm

Fetch

A domain for letting clients substitute browser's network layer with client code.

public IFetch Fetch { get; }

Property Value

IFetch

FileSystem

[Experimental("BIDICDP001")]
public IFileSystem FileSystem { get; }

Property Value

IFileSystem

HeadlessExperimental

This domain provides experimental commands only supported in headless mode.

[Experimental("BIDICDP001")]
public IHeadlessExperimental HeadlessExperimental { get; }

Property Value

IHeadlessExperimental

HeapProfiler

[Experimental("BIDICDP001")]
public IHeapProfiler HeapProfiler { get; }

Property Value

IHeapProfiler

IO

Input/Output operations for streams produced by DevTools.

public IIO IO { get; }

Property Value

IIO

IndexedDB

[Experimental("BIDICDP001")]
public IIndexedDB IndexedDB { get; }

Property Value

IIndexedDB

Input

public IInput Input { get; }

Property Value

IInput

Inspector

[Experimental("BIDICDP001")]
public IInspector Inspector { get; }

Property Value

IInspector

LayerTree

[Experimental("BIDICDP001")]
public ILayerTree LayerTree { get; }

Property Value

ILayerTree

Log

Provides access to log entries.

public ILog Log { get; }

Property Value

ILog

Media

This domain allows detailed inspection of media elements.

[Experimental("BIDICDP001")]
public IMedia Media { get; }

Property Value

IMedia

Memory

[Experimental("BIDICDP001")]
public IMemory Memory { get; }

Property Value

IMemory

Network

Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.

public INetwork Network { get; }

Property Value

INetwork

Overlay

This domain provides various functionality related to drawing atop the inspected page.

[Experimental("BIDICDP001")]
public IOverlay Overlay { get; }

Property Value

IOverlay

PWA

This domain allows interacting with the browser to control PWAs.

[Experimental("BIDICDP001")]
public IPWA PWA { get; }

Property Value

IPWA

Page

Actions and events related to the inspected page belong to the page domain.

public IPage Page { get; }

Property Value

IPage

Performance

public IPerformance Performance { get; }

Property Value

IPerformance

PerformanceTimeline

Reporting of performance timeline events, as specified in https://w3c.github.io/performance-timeline/#dom-performanceobserver.

[Experimental("BIDICDP001")]
public IPerformanceTimeline PerformanceTimeline { get; }

Property Value

IPerformanceTimeline

Preload

[Experimental("BIDICDP001")]
public IPreload Preload { get; }

Property Value

IPreload

Profiler

public IProfiler Profiler { get; }

Property Value

IProfiler

Runtime

Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.

public IRuntime Runtime { get; }

Property Value

IRuntime

Schema

This domain is deprecated.

[Obsolete]
public ISchema Schema { get; }

Property Value

ISchema

Security

public ISecurity Security { get; }

Property Value

ISecurity

ServiceWorker

[Experimental("BIDICDP001")]
public IServiceWorker ServiceWorker { get; }

Property Value

IServiceWorker

SmartCardEmulation

[Experimental("BIDICDP001")]
public ISmartCardEmulation SmartCardEmulation { get; }

Property Value

ISmartCardEmulation

Storage

[Experimental("BIDICDP001")]
public IStorage Storage { get; }

Property Value

IStorage

SystemInfo

The SystemInfo domain defines methods and events for querying low-level system information.

[Experimental("BIDICDP001")]
public ISystemInfo SystemInfo { get; }

Property Value

ISystemInfo

Target

Supports additional targets discovery and allows to attach to them.

public ITarget Target { get; }

Property Value

ITarget

Tethering

The Tethering domain defines methods and events for browser port binding.

[Experimental("BIDICDP001")]
public ITethering Tethering { get; }

Property Value

ITethering

Tracing

public ITracing Tracing { get; }

Property Value

ITracing

WebAudio

This domain allows inspection of Web Audio API. https://webaudio.github.io/web-audio-api/

[Experimental("BIDICDP001")]
public IWebAudio WebAudio { get; }

Property Value

IWebAudio

WebAuthn

This domain allows configuring virtual authenticators to test the WebAuthn API.

[Experimental("BIDICDP001")]
public IWebAuthn WebAuthn { get; }

Property Value

IWebAuthn

WebMCP

[Experimental("BIDICDP001")]
public IWebMCP WebMCP { get; }

Property Value

IWebMCP

Methods

GetSessionAsync(BrowsingContext, GetSessionOptions?, CancellationToken)

Gets the CDP session identifier for the specified browsing context.

public Task<GetSessionResult> GetSessionAsync(BrowsingContext context, GetSessionOptions? options = null, CancellationToken cancellationToken = default)

Parameters

context BrowsingContext

The browsing context to get the session for.

options GetSessionOptions

Optional command options.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetSessionResult>

The session result containing the CDP session identifier.

SendCommandAsync(string, JsonElement, string?, CancellationToken)

Sends a CDP command with the specified method and parameters.

public Task<SendCommandResult> SendCommandAsync(string method, JsonElement parameters, string? session = null, CancellationToken cancellationToken = default)

Parameters

method string

The CDP method name (e.g. "Page.navigate").

parameters JsonElement

The JSON parameters for the command.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SendCommandResult>

The raw command result.