Table of Contents

Class InputModule

Namespace
WebDriverBiDi.Input
Assembly
WebDriverBiDi.dll

The Input module contains commands and events relating to simulating user input.

public sealed class InputModule : Module
Inheritance
InputModule
Inherited Members

Constructors

InputModule(IBiDiModuleHost)

Initializes a new instance of the InputModule class.

public InputModule(IBiDiModuleHost driver)

Parameters

driver IBiDiModuleHost

The IBiDiModuleHost used in the module commands and events.

Fields

InputModuleName

The name of the input module.

public const string InputModuleName = "input"

Field Value

string

Properties

ModuleName

Gets the module name.

public override string ModuleName { get; }

Property Value

string

OnFileDialogOpened

Gets an observable event that notifies when a file dialog is opened.

[ObservableEventName("input.fileDialogOpened")]
public ObservableEvent<FileDialogOpenedEventArgs> OnFileDialogOpened { get; }

Property Value

ObservableEvent<FileDialogOpenedEventArgs>

Methods

PerformActionsAsync(PerformActionsCommandParameters, TimeSpan?, CancellationToken)

Performs a set of actions.

public Task<PerformActionsCommandResult> PerformActionsAsync(PerformActionsCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters PerformActionsCommandParameters

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<PerformActionsCommandResult>

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.

ReleaseActionsAsync(ReleaseActionsCommandParameters, TimeSpan?, CancellationToken)

Releases pending actions.

public Task<ReleaseActionsCommandResult> ReleaseActionsAsync(ReleaseActionsCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters ReleaseActionsCommandParameters

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<ReleaseActionsCommandResult>

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.

SetFilesAsync(SetFilesCommandParameters, TimeSpan?, CancellationToken)

Sets the files on a file upload element. The element must be of type {input type="file"}.

public Task<SetFilesCommandResult> SetFilesAsync(SetFilesCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

commandParameters SetFilesCommandParameters

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<SetFilesCommandResult>

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.