Class SessionModuleExtensions
- Namespace
- WebDriverBiDi.Session
- Assembly
- WebDriverBiDi.Extensions.dll
Provides extension methods for the Session module.
public static class SessionModuleExtensions
- Inheritance
-
SessionModuleExtensions
- Inherited Members
Methods
SubscribeAsync(SessionModule, IEnumerable<string>, IEnumerable<string>?, TimeSpan?, CancellationToken)
Subscribes to events, in every browsing context or in the given ones.
public static Task<string> SubscribeAsync(this SessionModule module, IEnumerable<string> eventNames, IEnumerable<string>? browsingContextIds = null, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
moduleSessionModuleThe SessionModule to extend.
eventNamesIEnumerable<string>The names of the events, such as "log.entryAdded".
browsingContextIdsIEnumerable<string>The browsing contexts in which to subscribe, or null for all.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA token that cancels waiting for the command's response.
Returns
- Task<string>
The ID of the subscription, for UnsubscribeAsync(SessionModule, string, TimeSpan?, CancellationToken).
UnsubscribeAsync(SessionModule, string, TimeSpan?, CancellationToken)
Removes a subscription.
public static Task UnsubscribeAsync(this SessionModule module, string subscriptionId, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)
Parameters
moduleSessionModuleThe SessionModule to extend.
subscriptionIdstringThe ID of the subscription.
timeoutOverrideTimeSpan?The timeout override to use for the command. If omitted, the value of DefaultCommandTimeout is used.
cancellationTokenCancellationTokenA token that cancels waiting for the command's response.
Returns
- Task
A task representing the asynchronous operation.