Class StorageModule
- Namespace
- WebDriverBiDi.Storage
- Assembly
- WebDriverBiDi.dll
The Storage module contains commands relating to browser storage such as cookies. The specification defines no events for this module.
public sealed class StorageModule : Module
- Inheritance
-
StorageModule
- Inherited Members
Constructors
StorageModule(IBiDiModuleHost)
Initializes a new instance of the StorageModule class.
public StorageModule(IBiDiModuleHost driver)
Parameters
driverIBiDiModuleHostThe IBiDiModuleHost used in the module commands and events.
Fields
StorageModuleName
The name of the storage module.
public const string StorageModuleName = "storage"
Field Value
Properties
ModuleName
Gets the module name.
public override string ModuleName { get; }
Property Value
Methods
DeleteCookiesAsync(DeleteCookiesCommandParameters?, TimeSpan?, CancellationToken)
Deletes cookies from the browser session.
public Task<DeleteCookiesCommandResult> DeleteCookiesAsync(DeleteCookiesCommandParameters? commandParameters = null, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersDeleteCookiesCommandParametersThe parameters for the command. If omitted, or if null, the command is sent with default parameters.
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<DeleteCookiesCommandResult>
The result of the command.
Exceptions
- 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.
GetCookiesAsync(GetCookiesCommandParameters?, TimeSpan?, CancellationToken)
Gets cookies from the browser session.
public Task<GetCookiesCommandResult> GetCookiesAsync(GetCookiesCommandParameters? commandParameters = null, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersGetCookiesCommandParametersThe parameters for the command. If omitted, or if null, the command is sent with default parameters.
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<GetCookiesCommandResult>
The result of the command.
Exceptions
- 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.
SetCookieAsync(SetCookieCommandParameters, TimeSpan?, CancellationToken)
Sets a cookie in the browser session.
public Task<SetCookieCommandResult> SetCookieAsync(SetCookieCommandParameters commandParameters, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
commandParametersSetCookieCommandParametersThe 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<SetCookieCommandResult>
The result of the command.
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.