Table of Contents

Class SubscribeCommandParameters

Namespace
WebDriverBiDi.Session
Assembly
WebDriverBiDi.dll

Provides parameters for the session.subscribe command.

public class SubscribeCommandParameters : CommandParameters<SubscribeCommandResult>
Inheritance
SubscribeCommandParameters
Inherited Members

Constructors

SubscribeCommandParameters(IList<string>, IList<string>?, IList<string>?)

Initializes a new instance of the SubscribeCommandParameters class.

public SubscribeCommandParameters(IList<string> events, IList<string>? contexts = null, IList<string>? userContexts = null)

Parameters

events IList<string>

The list of events to which to subscribe.

contexts IList<string>

The list of browsing context IDs for which to subscribe to the specified events.

userContexts IList<string>

The list of user context IDs for which to subscribe to the specified events.

Remarks

The specification requires a subscription to name at least one event. Unlike values whose specification constraints the remote end enforces, an empty events list is rejected here: a subscription to no events cannot be meaningful under any revision of the specification, and accepting it would only defer a certain failure to the remote end.

Exceptions

ArgumentException

Thrown when no events are specified in the events list.

SubscribeCommandParameters(string, IList<string>?, IList<string>?)

Initializes a new instance of the SubscribeCommandParameters class for a single event.

public SubscribeCommandParameters(string eventName, IList<string>? contexts = null, IList<string>? userContexts = null)

Parameters

eventName string

The event to which to subscribe.

contexts IList<string>

The list of browsing context IDs for which to subscribe to the specified event.

userContexts IList<string>

The list of user context IDs for which to subscribe to the specified event.

Properties

Contexts

Gets the list of browsing context IDs for which to subscribe to the specified events.

[JsonIgnore]
public List<string> Contexts { get; }

Property Value

List<string>

Events

Gets the list of events to which to subscribe.

[JsonPropertyName("events")]
public List<string> Events { get; }

Property Value

List<string>

MethodName

Gets the method name of the command.

[JsonIgnore]
public override string MethodName { get; }

Property Value

string

UserContexts

Gets the list of user context IDs for which to subscribe to the specified events.

[JsonIgnore]
public List<string> UserContexts { get; }

Property Value

List<string>