Class EmulationModule
- Namespace
- WebDriverBiDi.Emulation
- Assembly
- WebDriverBiDi.dll
The Emulation module contains commands relating to emulating various conditions in the browser.
public sealed class EmulationModule : Module
- Inheritance
-
EmulationModule
- Inherited Members
Constructors
EmulationModule(IBiDiModuleHost)
Initializes a new instance of the EmulationModule class.
public EmulationModule(IBiDiModuleHost driver)
Parameters
driverIBiDiModuleHostThe IBiDiModuleHost used in the module commands and events.
Fields
EmulationModuleName
The name of the emulation module.
public const string EmulationModuleName = "emulation"
Field Value
Properties
ModuleName
Gets the module name.
public override string ModuleName { get; }
Property Value
Methods
SetForcedColorsModeThemeOverrideAsync(SetForcedColorsModeThemeOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for forced color themes for the specified contexts or user contexts.
public Task<SetForcedColorsModeThemeOverrideCommandResult> SetForcedColorsModeThemeOverrideAsync(SetForcedColorsModeThemeOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetForcedColorsModeThemeOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetForcedColorsModeThemeOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetGeolocationOverrideAsync(SetGeolocationOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the geolocation for the specified contexts or user contexts.
public Task<SetGeolocationOverrideCommandResult> SetGeolocationOverrideAsync(SetGeolocationOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetGeolocationOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetGeolocationOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetLocaleOverrideAsync(SetLocaleOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the locale for the specified contexts or user contexts.
public Task<SetLocaleOverrideCommandResult> SetLocaleOverrideAsync(SetLocaleOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetLocaleOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetLocaleOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetMediaFeaturesOverrideAsync(SetMediaFeaturesOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the media features for the specified contexts or user contexts.
public Task<SetMediaFeaturesOverrideCommandResult> SetMediaFeaturesOverrideAsync(SetMediaFeaturesOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetMediaFeaturesOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetMediaFeaturesOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetNetworkConditionsAsync(SetNetworkConditionsCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated network conditions for the specified contexts or user contexts.
public Task<SetNetworkConditionsCommandResult> SetNetworkConditionsAsync(SetNetworkConditionsCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetNetworkConditionsCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetNetworkConditionsCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetScreenOrientationOverrideAsync(SetScreenOrientationOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the screen orientation for the specified contexts or user contexts.
public Task<SetScreenOrientationOverrideCommandResult> SetScreenOrientationOverrideAsync(SetScreenOrientationOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetScreenOrientationOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetScreenOrientationOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetScreenSettingsOverrideAsync(SetScreenSettingsOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the screen settings (height, width, etc.) for the specified contexts or user contexts.
public Task<SetScreenSettingsOverrideCommandResult> SetScreenSettingsOverrideAsync(SetScreenSettingsOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetScreenSettingsOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetScreenSettingsOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetScriptingEnabledAsync(SetScriptingEnabledCommandParameters, TimeSpan?, CancellationToken)
Sets the override for whether JavaScript is enabled for the specified contexts or user contexts. Note carefully that this is only useful for simulating the disabling of JavaScript.
public Task<SetScriptingEnabledCommandResult> SetScriptingEnabledAsync(SetScriptingEnabledCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetScriptingEnabledCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetScriptingEnabledCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetScrollbarTypeOverrideAsync(SetScrollbarTypeOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the override for emulating the type of scroll bar displayed in the browser.
public Task<SetScrollbarTypeOverrideCommandResult> SetScrollbarTypeOverrideAsync(SetScrollbarTypeOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetScrollbarTypeOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetScrollbarTypeOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetTextLayoutModeOverrideAsync(SetTextLayoutModeOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the text layout mode for the specified contexts or user contexts.
public Task<SetTextLayoutModeOverrideCommandResult> SetTextLayoutModeOverrideAsync(SetTextLayoutModeOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetTextLayoutModeOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetTextLayoutModeOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetTimeZoneOverrideAsync(SetTimeZoneOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the time zone for the specified contexts or user contexts.
public Task<SetTimeZoneOverrideCommandResult> SetTimeZoneOverrideAsync(SetTimeZoneOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetTimeZoneOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetTimeZoneOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetTouchOverrideAsync(SetTouchOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for touch events for the specified contexts or user contexts.
public Task<SetTouchOverrideCommandResult> SetTouchOverrideAsync(SetTouchOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetTouchOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetTouchOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetUserAgentOverrideAsync(SetUserAgentOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the user agent string for the specified contexts or user contexts.
public Task<SetUserAgentOverrideCommandResult> SetUserAgentOverrideAsync(SetUserAgentOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetUserAgentOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetUserAgentOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.
SetViewportMetaOverrideAsync(SetViewportMetaOverrideCommandParameters, TimeSpan?, CancellationToken)
Sets the emulated override for the <meta name=viewport> tag for the specified contexts or user contexts.
public Task<SetViewportMetaOverrideCommandResult> SetViewportMetaOverrideAsync(SetViewportMetaOverrideCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetViewportMetaOverrideCommandParametersThe parameters for the command.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA cancellation token used to propagate notification that the operation should be canceled. Omitting this argument is the equivalent of using None.
Returns
- Task<SetViewportMetaOverrideCommandResult>
An empty command result.
Exceptions
- ArgumentNullException
Thrown when
commandParametersis null.- ArgumentOutOfRangeException
Thrown when
timeoutOverrideis 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
cancellationTokenis canceled.- ObjectDisposedException
Thrown when the driver has been disposed.