Table of Contents

Interface IDevToolsSession

Namespace
OpenQA.Selenium.DevTools
Assembly
WebDriver.dll

Represents a WebSocket connection to a running DevTools instance that can be used to send commands and recieve events.

public interface IDevToolsSession : IDisposable
Inherited Members

Methods

GetVersionSpecificDomains<T>()

Gets the domains that are valid for the specfied version of Developer Tools connection.

T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains

Returns

T

The version-specific domains for this Developer Tools connection.

Type Parameters

T

A DevToolsSessionDomains type specific to the version of Develoepr Tools with which to communicate.

SendCommand(string, JsonNode, CancellationToken, int?, bool)

Returns a JsonNode based on a command created with the specified command name and params.

Task<JsonElement?> SendCommand(string commandName, JsonNode @params, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)

Parameters

commandName string

The name of the command to send.

params JsonNode

The parameters of the command as a JsonNode object

cancellationToken CancellationToken

A CancellationToken object to allow for cancellation of the command.

millisecondsTimeout int?

The execution timeout of the command in milliseconds.

throwExceptionIfResponseNotReceived bool

true to throw an exception if a response is not received; otherwise, false.

Returns

Task<JsonElement?>

The command response object implementing the ICommandResponse<T> interface.

SendCommand<TCommand>(TCommand, CancellationToken, int?, bool)

Sends the specified command and returns the associated command response.

Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived) where TCommand : ICommand

Parameters

command TCommand

The command to be sent.

cancellationToken CancellationToken

A CancellationToken object to allow for cancellation of the command.

millisecondsTimeout int?

The execution timeout of the command in milliseconds.

throwExceptionIfResponseNotReceived bool

true to throw an exception if a response is not received; otherwise, false.

Returns

Task<ICommandResponse<TCommand>>

The command response object implementing the ICommandResponse<T> interface.

Type Parameters

TCommand

A command object implementing the ICommand interface.

SendCommand<TCommand, TCommandResponse>(TCommand, CancellationToken, int?, bool)

Sends the specified command and returns the associated command response.

Task<TCommandResponse> SendCommand<TCommand, TCommandResponse>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived) where TCommand : ICommand where TCommandResponse : ICommandResponse<TCommand>

Parameters

command TCommand

The command to send.

cancellationToken CancellationToken

A CancellationToken object to allow for cancellation of the command.

millisecondsTimeout int?

The execution timeout of the command in milliseconds.

throwExceptionIfResponseNotReceived bool

true to throw an exception if a response is not received; otherwise, false.

Returns

Task<TCommandResponse>

The command response object implementing the ICommandResponse<T> interface.

Type Parameters

TCommand

A command object implementing the ICommand interface.

TCommandResponse

A response object implementing the ICommandResponse interface.

Events

DevToolsEventReceived

Event raised an event notification is received from the DevTools session.

event EventHandler<DevToolsEventReceivedEventArgs> DevToolsEventReceived

Event Type

EventHandler<DevToolsEventReceivedEventArgs>

LogMessage

Event raised when the DevToolsSession logs informational messages.

event EventHandler<DevToolsSessionLogMessageEventArgs> LogMessage

Event Type

EventHandler<DevToolsSessionLogMessageEventArgs>