Table of Contents

Class WebMCPAdapter

Namespace
OpenQA.Selenium.DevTools.V147.WebMCP
Assembly
Selenium.WebDriver.dll

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

public class WebMCPAdapter
Inheritance
WebMCPAdapter
Inherited Members

Constructors

WebMCPAdapter(IDevToolsSession)

Initializes a new instance of the WebMCPAdapter class.

public WebMCPAdapter(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

Enable(EnableCommandSettings?, CancellationToken, int?, bool)

Enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for all currently registered tools.

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

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

Events

ToolsAdded

Event fired when new tools are added.

public event EventHandler<ToolsAddedEventArgs>? ToolsAdded

Event Type

EventHandler<ToolsAddedEventArgs>

ToolsRemoved

Event fired when tools are removed.

public event EventHandler<ToolsRemovedEventArgs>? ToolsRemoved

Event Type

EventHandler<ToolsRemovedEventArgs>