Table of Contents

Class CastAdapter

Namespace
OpenQA.Selenium.DevTools.V146.Cast
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Cast domain to simplify the command interface.

public class CastAdapter
Inheritance
CastAdapter
Inherited Members

Constructors

CastAdapter(IDevToolsSession)

Initializes a new instance of the CastAdapter class.

public CastAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Stops observing for sinks and issues.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings, CancellationToken, int?, bool)

Starts observing for sinks that can be used for tab mirroring, and if set, sinks compatible with |presentationUrl| as well. When sinks are found, a |sinksUpdated| event is fired. Also starts observing for issue messages. When an issue is added or removed, an |issueUpdated| event is fired.

public Task<EnableCommandResponse?> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

SetSinkToUse(SetSinkToUseCommandSettings, CancellationToken, int?, bool)

Sets a sink to be used when the web page requests the browser to choose a sink via Presentation API, Remote Playback API, or Cast SDK.

public Task<SetSinkToUseCommandResponse?> SetSinkToUse(SetSinkToUseCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSinkToUseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSinkToUseCommandResponse>

StartDesktopMirroring(StartDesktopMirroringCommandSettings, CancellationToken, int?, bool)

Starts mirroring the desktop to the sink.

public Task<StartDesktopMirroringCommandResponse?> StartDesktopMirroring(StartDesktopMirroringCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartDesktopMirroringCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartDesktopMirroringCommandResponse>

StartTabMirroring(StartTabMirroringCommandSettings, CancellationToken, int?, bool)

Starts mirroring the tab to the sink.

public Task<StartTabMirroringCommandResponse?> StartTabMirroring(StartTabMirroringCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartTabMirroringCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartTabMirroringCommandResponse>

StopCasting(StopCastingCommandSettings, CancellationToken, int?, bool)

Stops the active Cast session on the sink.

public Task<StopCastingCommandResponse?> StopCasting(StopCastingCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopCastingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopCastingCommandResponse>

Events

IssueUpdated

This is fired whenever the outstanding issue/error message changes. |issueMessage| is empty if there is no issue.

public event EventHandler<IssueUpdatedEventArgs>? IssueUpdated

Event Type

EventHandler<IssueUpdatedEventArgs>

SinksUpdated

This is fired whenever the list of available sinks changes. A sink is a device or a software surface that you can cast to.

public event EventHandler<SinksUpdatedEventArgs>? SinksUpdated

Event Type

EventHandler<SinksUpdatedEventArgs>