Table of Contents

Class BrowsingContextModule

Namespace
WebDriverBiDi.BrowsingContext
Assembly
WebDriverBiDi.dll

The BrowsingContext module contains commands and events relating to browsing contexts.

public sealed class BrowsingContextModule : Module
Inheritance
BrowsingContextModule
Inherited Members

Constructors

BrowsingContextModule(IBiDiModuleHost)

Initializes a new instance of the BrowsingContextModule class.

public BrowsingContextModule(IBiDiModuleHost driver)

Parameters

driver IBiDiModuleHost

The IBiDiModuleHost used in the module commands and events.

Fields

BrowsingContextModuleName

The name of the browsingContext module.

public const string BrowsingContextModuleName = "browsingContext"

Field Value

string

Properties

ModuleName

Gets the module name.

public override string ModuleName { get; }

Property Value

string

OnContextCreated

Gets an observable event that notifies when a browsing context is created.

[ObservableEventName("browsingContext.contextCreated")]
public ObservableEvent<ContextCreatedEventArgs> OnContextCreated { get; }

Property Value

ObservableEvent<ContextCreatedEventArgs>

OnContextDestroyed

Gets an observable event that notifies when a browsing context is destroyed.

[ObservableEventName("browsingContext.contextDestroyed")]
public ObservableEvent<ContextDestroyedEventArgs> OnContextDestroyed { get; }

Property Value

ObservableEvent<ContextDestroyedEventArgs>

OnDomContentLoaded

Gets an observable event that notifies when the DOM content in a browsing context is loaded.

[ObservableEventName("browsingContext.domContentLoaded")]
public ObservableEvent<NavigationEventArgs> OnDomContentLoaded { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnDownloadEnd

Gets an observable event that notifies when a download has ended.

[ObservableEventName("browsingContext.downloadEnd")]
public ObservableEvent<DownloadEndEventArgs> OnDownloadEnd { get; }

Property Value

ObservableEvent<DownloadEndEventArgs>

OnDownloadWillBegin

Gets an observable event that notifies when a download in a browsing context is about to begin.

[ObservableEventName("browsingContext.downloadWillBegin")]
public ObservableEvent<DownloadWillBeginEventArgs> OnDownloadWillBegin { get; }

Property Value

ObservableEvent<DownloadWillBeginEventArgs>

OnFragmentNavigated

Gets an observable event that notifies when a browsing context fragment is navigated.

[ObservableEventName("browsingContext.fragmentNavigated")]
public ObservableEvent<NavigationEventArgs> OnFragmentNavigated { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnHistoryUpdated

Gets an observable event that notifies when the browser history is updated.

[ObservableEventName("browsingContext.historyUpdated")]
public ObservableEvent<HistoryUpdatedEventArgs> OnHistoryUpdated { get; }

Property Value

ObservableEvent<HistoryUpdatedEventArgs>

OnLoad

Gets an observable event that notifies when the content in a browsing context is loaded.

[ObservableEventName("browsingContext.load")]
public ObservableEvent<NavigationEventArgs> OnLoad { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnNavigationAborted

Gets an observable event that notifies when a browsing context navigation is aborted.

[ObservableEventName("browsingContext.navigationAborted")]
public ObservableEvent<NavigationEventArgs> OnNavigationAborted { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnNavigationCommitted

Gets an observable event that notifies when a browsing context navigation is committed.

[ObservableEventName("browsingContext.navigationCommitted")]
public ObservableEvent<NavigationEventArgs> OnNavigationCommitted { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnNavigationFailed

Gets an observable event that notifies when a browsing context navigation fails.

[ObservableEventName("browsingContext.navigationFailed")]
public ObservableEvent<NavigationEventArgs> OnNavigationFailed { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnNavigationStarted

Gets an observable event that notifies when a browsing context navigation is started.

[ObservableEventName("browsingContext.navigationStarted")]
public ObservableEvent<NavigationEventArgs> OnNavigationStarted { get; }

Property Value

ObservableEvent<NavigationEventArgs>

OnUserPromptClosed

Gets an observable event that notifies when a user prompt is closed.

[ObservableEventName("browsingContext.userPromptClosed")]
public ObservableEvent<UserPromptClosedEventArgs> OnUserPromptClosed { get; }

Property Value

ObservableEvent<UserPromptClosedEventArgs>

OnUserPromptOpened

Gets an observable event that notifies when a user prompt is opened.

[ObservableEventName("browsingContext.userPromptOpened")]
public ObservableEvent<UserPromptOpenedEventArgs> OnUserPromptOpened { get; }

Property Value

ObservableEvent<UserPromptOpenedEventArgs>

Methods

ActivateAsync(ActivateCommandParameters, TimeSpan?, CancellationToken)

Activates a browsing context by bringing it to the foreground.

public Task<ActivateCommandResult> ActivateAsync(ActivateCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters ActivateCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<ActivateCommandResult>

An empty command result.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

CaptureScreenshotAsync(CaptureScreenshotCommandParameters, TimeSpan?, CancellationToken)

Captures a screenshot of the current page in the browsing context.

public Task<CaptureScreenshotCommandResult> CaptureScreenshotAsync(CaptureScreenshotCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters CaptureScreenshotCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<CaptureScreenshotCommandResult>

The result of the command containing a base64-encoded screenshot.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

CloseAsync(CloseCommandParameters, TimeSpan?, CancellationToken)

Closes the browsing context.

public Task<CloseCommandResult> CloseAsync(CloseCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters CloseCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<CloseCommandResult>

An empty command result.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

CreateAsync(CreateCommandParameters, TimeSpan?, CancellationToken)

Creates a new browsing context.

public Task<CreateCommandResult> CreateAsync(CreateCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters CreateCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<CreateCommandResult>

The result of the command including the ID of the new context.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

GetTreeAsync(GetTreeCommandParameters?, TimeSpan?, CancellationToken)

Gets a tree of browsing contexts associated with a specified context.

public Task<GetTreeCommandResult> GetTreeAsync(GetTreeCommandParameters? commandParameters = null, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters GetTreeCommandParameters

The parameters for the command. If omitted, or if null, the command is sent with default parameters.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<GetTreeCommandResult>

The tree of associated browsing contexts.

Exceptions

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

HandleUserPromptAsync(HandleUserPromptCommandParameters, TimeSpan?, CancellationToken)

Handles a user prompt.

public Task<HandleUserPromptCommandResult> HandleUserPromptAsync(HandleUserPromptCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters HandleUserPromptCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<HandleUserPromptCommandResult>

An empty command result.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

LocateNodesAsync(LocateNodesCommandParameters, TimeSpan?, CancellationToken)

Locates nodes within a browsing context.

public Task<LocateNodesCommandResult> LocateNodesAsync(LocateNodesCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters LocateNodesCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<LocateNodesCommandResult>

The result of the command containing the located nodes, if any.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

NavigateAsync(NavigateCommandParameters, TimeSpan?, CancellationToken)

Navigates a browsing context to a new URL.

public Task<NavigateCommandResult> NavigateAsync(NavigateCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters NavigateCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<NavigateCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

PrintAsync(PrintCommandParameters, TimeSpan?, CancellationToken)

Prints a PDF of the current page in the browsing context.

public Task<PrintCommandResult> PrintAsync(PrintCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters PrintCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<PrintCommandResult>

The result of the command containing a base64-encoded PDF of the current page.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

ReloadAsync(ReloadCommandParameters, TimeSpan?, CancellationToken)

Reloads the current document of a browsing context.

public Task<ReloadCommandResult> ReloadAsync(ReloadCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters ReloadCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<ReloadCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

SetBypassCSPAsync(SetBypassCSPCommandParameters, TimeSpan?, CancellationToken)

Sets whether to bypass content security policies (CSP) for a browsing context.

public Task<SetBypassCSPCommandResult> SetBypassCSPAsync(SetBypassCSPCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters SetBypassCSPCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<SetBypassCSPCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

SetViewportAsync(SetViewportCommandParameters, TimeSpan?, CancellationToken)

Sets the viewport of a browsing context to the specified dimensions.

public Task<SetViewportCommandResult> SetViewportAsync(SetViewportCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters SetViewportCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<SetViewportCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

StartScreencastAsync(StartScreencastCommandParameters, TimeSpan?, CancellationToken)

Starts capture of a screencast for a browsing context.

public Task<StartScreencastCommandResult> StartScreencastAsync(StartScreencastCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters StartScreencastCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<StartScreencastCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

StopScreencastAsync(StopScreencastCommandParameters, TimeSpan?, CancellationToken)

Stops capture of a screencast for a browsing context.

public Task<StopScreencastCommandResult> StopScreencastAsync(StopScreencastCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters StopScreencastCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<StopScreencastCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.

TraverseHistoryAsync(TraverseHistoryCommandParameters, TimeSpan?, CancellationToken)

Traverses the history entries of a specific browsing context.

public Task<TraverseHistoryCommandResult> TraverseHistoryAsync(TraverseHistoryCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters TraverseHistoryCommandParameters

The parameters for the command.

timeoutOverride TimeSpan?

The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.

cancellationToken CancellationToken

A cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.

Returns

Task<TraverseHistoryCommandResult>

The result of the command.

Exceptions

ArgumentNullException

Thrown when commandParameters is null.

ArgumentOutOfRangeException

Thrown when timeoutOverride is negative (other than InfiniteTimeSpan) or exceeds the maximum supported timer duration.

WebDriverBiDiCommandException

Thrown when the remote end returns an error response for the command.

WebDriverBiDiSerializationException

Thrown when the command parameters cannot be serialized, or the response cannot be deserialized.

WebDriverBiDiTimeoutException

Thrown when the command does not complete within the timeout.

WebDriverBiDiConnectionException

Thrown when the driver is not connected to a remote end, or the connection is lost before the command completes.

WebDriverBiDiException

Thrown when the command is canceled, or its response carries no result or a result of the wrong type.

OperationCanceledException

Thrown when cancellationToken is canceled.

ObjectDisposedException

Thrown when the driver has been disposed.