Table of Contents

Class BackgroundServiceAdapter

Namespace
OpenQA.Selenium.DevTools.V148.BackgroundService
Assembly
Selenium.WebDriver.dll

Represents an adapter for the BackgroundService domain to simplify the command interface.

public class BackgroundServiceAdapter
Inheritance
BackgroundServiceAdapter
Inherited Members

Constructors

BackgroundServiceAdapter(IDevToolsSession)

Initializes a new instance of the BackgroundServiceAdapter class.

public BackgroundServiceAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

ClearEvents(ClearEventsCommandSettings, CancellationToken, int?, bool)

Clears all stored data for the service.

public Task<ClearEventsCommandResponse?> ClearEvents(ClearEventsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearEventsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearEventsCommandResponse>

SetRecording(SetRecordingCommandSettings, CancellationToken, int?, bool)

Set the recording state for the service.

public Task<SetRecordingCommandResponse?> SetRecording(SetRecordingCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetRecordingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetRecordingCommandResponse>

StartObserving(StartObservingCommandSettings, CancellationToken, int?, bool)

Enables event updates for the service.

public Task<StartObservingCommandResponse?> StartObserving(StartObservingCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartObservingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartObservingCommandResponse>

StopObserving(StopObservingCommandSettings, CancellationToken, int?, bool)

Disables event updates for the service.

public Task<StopObservingCommandResponse?> StopObserving(StopObservingCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopObservingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopObservingCommandResponse>

Events

BackgroundServiceEventReceived

Called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.

public event EventHandler<BackgroundServiceEventReceivedEventArgs>? BackgroundServiceEventReceived

Event Type

EventHandler<BackgroundServiceEventReceivedEventArgs>

RecordingStateChanged

Called when the recording state for the service has been updated.

public event EventHandler<RecordingStateChangedEventArgs>? RecordingStateChanged

Event Type

EventHandler<RecordingStateChangedEventArgs>