Table of Contents

Class SharedReferenceInfo

Namespace
WebDriverBiDi.Script
Assembly
WebDriverBiDi.dll

Provides information about a received reference to a remote object identified by a shared ID, such as a node. Use ToSharedReference() to obtain a mutable SharedReference that can be passed as an argument to subsequent commands.

public record SharedReferenceInfo : IEquatable<SharedReferenceInfo>
Inheritance
SharedReferenceInfo
Implements
Inherited Members

Constructors

SharedReferenceInfo(SharedReferenceInfo)

protected SharedReferenceInfo(SharedReferenceInfo original)

Parameters

original SharedReferenceInfo

Properties

AdditionalData

Gets the read-only dictionary of additional properties received with this reference.

[JsonIgnore]
public ReceivedDataDictionary AdditionalData { get; }

Property Value

ReceivedDataDictionary

Remarks

The protocol defines script.SharedReference as extensible, so a remote end may place vendor-specific properties beside sharedId and handle. They are preserved here, and ToSharedReference() copies them into the AdditionalData of the reference it returns so that they are sent back to the remote end with the reference.

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Handle

Gets the handle of the remote object, if any.

[JsonPropertyName("handle")]
[JsonInclude]
public string? Handle { get; }

Property Value

string

SharedId

Gets the shared ID of the remote object.

[JsonPropertyName("sharedId")]
[JsonRequired]
[JsonInclude]
public string SharedId { get; }

Property Value

string

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(SharedReferenceInfo?)

public virtual bool Equals(SharedReferenceInfo? other)

Parameters

other SharedReferenceInfo

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToSharedReference()

Converts this received reference to a mutable SharedReference for use as an argument to subsequent commands. Any additional properties received with this reference are copied to the AdditionalData of the returned reference.

public SharedReference ToSharedReference()

Returns

SharedReference

A SharedReference representing this reference.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(SharedReferenceInfo?, SharedReferenceInfo?)

public static bool operator ==(SharedReferenceInfo? left, SharedReferenceInfo? right)

Parameters

left SharedReferenceInfo
right SharedReferenceInfo

Returns

bool

operator !=(SharedReferenceInfo?, SharedReferenceInfo?)

public static bool operator !=(SharedReferenceInfo? left, SharedReferenceInfo? right)

Parameters

left SharedReferenceInfo
right SharedReferenceInfo

Returns

bool