Table of Contents

Interface IBackgroundService

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

Defines events for background web platform features.

[Experimental("BIDICDP001")]
public interface IBackgroundService

Properties

BackgroundServiceEventReceived

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

IEventSource<BackgroundServiceEventReceivedEventArgs> BackgroundServiceEventReceived { get; }

Property Value

IEventSource<BackgroundServiceEventReceivedEventArgs>

Remarks

Event args (BackgroundServiceEventReceivedEventArgs):

  • BackgroundServiceEvent

RecordingStateChanged

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

IEventSource<RecordingStateChangedEventArgs> RecordingStateChanged { get; }

Property Value

IEventSource<RecordingStateChangedEventArgs>

Remarks

Event args (RecordingStateChangedEventArgs):

  • IsRecording
  • Service

Methods

ClearEventsAsync(ServiceName, string?, CancellationToken)

Clears all stored data for the service.

Task<ClearEventsResult> ClearEventsAsync(ServiceName service, string? session = null, CancellationToken cancellationToken = default)

Parameters

service ServiceName
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ClearEventsResult>

A task representing the asynchronous operation, containing a ClearEventsResult.

SetRecordingAsync(bool, ServiceName, string?, CancellationToken)

Set the recording state for the service.

Task<SetRecordingResult> SetRecordingAsync(bool shouldRecord, ServiceName service, string? session = null, CancellationToken cancellationToken = default)

Parameters

shouldRecord bool
service ServiceName
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetRecordingResult>

A task representing the asynchronous operation, containing a SetRecordingResult.

StartObservingAsync(ServiceName, string?, CancellationToken)

Enables event updates for the service.

Task<StartObservingResult> StartObservingAsync(ServiceName service, string? session = null, CancellationToken cancellationToken = default)

Parameters

service ServiceName
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartObservingResult>

A task representing the asynchronous operation, containing a StartObservingResult.

StopObservingAsync(ServiceName, string?, CancellationToken)

Disables event updates for the service.

Task<StopObservingResult> StopObservingAsync(ServiceName service, string? session = null, CancellationToken cancellationToken = default)

Parameters

service ServiceName
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopObservingResult>

A task representing the asynchronous operation, containing a StopObservingResult.