Table of Contents

Class WebMCPAdapter

Namespace
OpenQA.Selenium.DevTools.V148.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

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

Disables the WebMCP domain.

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)

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

ToolInvoked

Event fired when a tool invocation starts.

public event EventHandler<ToolInvokedEventArgs>? ToolInvoked

Event Type

EventHandler<ToolInvokedEventArgs>

ToolResponded

Event fired when a tool invocation completes or fails.

public event EventHandler<ToolRespondedEventArgs>? ToolResponded

Event Type

EventHandler<ToolRespondedEventArgs>

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>