Table of Contents

Class OverlayAdapter

Namespace
OpenQA.Selenium.DevTools.V148.Overlay
Assembly
Selenium.WebDriver.dll

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

public class OverlayAdapter
Inheritance
OverlayAdapter
Inherited Members

Constructors

OverlayAdapter(IDevToolsSession)

Initializes a new instance of the OverlayAdapter class.

public OverlayAdapter(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 domain notifications.

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 domain notifications.

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>

GetGridHighlightObjectsForTest(GetGridHighlightObjectsForTestCommandSettings, CancellationToken, int?, bool)

For Persistent Grid testing.

public Task<GetGridHighlightObjectsForTestCommandResponse> GetGridHighlightObjectsForTest(GetGridHighlightObjectsForTestCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetGridHighlightObjectsForTestCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetGridHighlightObjectsForTestCommandResponse>

GetHighlightObjectForTest(GetHighlightObjectForTestCommandSettings, CancellationToken, int?, bool)

For testing.

public Task<GetHighlightObjectForTestCommandResponse> GetHighlightObjectForTest(GetHighlightObjectForTestCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetHighlightObjectForTestCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetHighlightObjectForTestCommandResponse>

GetSourceOrderHighlightObjectForTest(GetSourceOrderHighlightObjectForTestCommandSettings, CancellationToken, int?, bool)

For Source Order Viewer testing.

public Task<GetSourceOrderHighlightObjectForTestCommandResponse> GetSourceOrderHighlightObjectForTest(GetSourceOrderHighlightObjectForTestCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetSourceOrderHighlightObjectForTestCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetSourceOrderHighlightObjectForTestCommandResponse>

HideHighlight(HideHighlightCommandSettings?, CancellationToken, int?, bool)

Hides any highlight.

public Task<HideHighlightCommandResponse?> HideHighlight(HideHighlightCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HideHighlightCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HideHighlightCommandResponse>

HighlightFrame(HighlightFrameCommandSettings, CancellationToken, int?, bool)

Highlights owner element of the frame with given id. Deprecated: Doesn't work reliably and cannot be fixed due to process separation (the owner node might be in a different process). Determine the owner node in the client and use highlightNode.

public Task<HighlightFrameCommandResponse?> HighlightFrame(HighlightFrameCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HighlightFrameCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HighlightFrameCommandResponse>

HighlightNode(HighlightNodeCommandSettings, CancellationToken, int?, bool)

Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.

public Task<HighlightNodeCommandResponse?> HighlightNode(HighlightNodeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HighlightNodeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HighlightNodeCommandResponse>

HighlightQuad(HighlightQuadCommandSettings, CancellationToken, int?, bool)

Highlights given quad. Coordinates are absolute with respect to the main frame viewport.

public Task<HighlightQuadCommandResponse?> HighlightQuad(HighlightQuadCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HighlightQuadCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HighlightQuadCommandResponse>

HighlightRect(HighlightRectCommandSettings, CancellationToken, int?, bool)

Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. Issue: the method does not handle device pixel ratio (DPR) correctly. The coordinates currently have to be adjusted by the client if DPR is not 1 (see crbug.com/437807128).

public Task<HighlightRectCommandResponse?> HighlightRect(HighlightRectCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HighlightRectCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HighlightRectCommandResponse>

HighlightSourceOrder(HighlightSourceOrderCommandSettings, CancellationToken, int?, bool)

Highlights the source order of the children of the DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.

public Task<HighlightSourceOrderCommandResponse?> HighlightSourceOrder(HighlightSourceOrderCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HighlightSourceOrderCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HighlightSourceOrderCommandResponse>

SetInspectMode(SetInspectModeCommandSettings, CancellationToken, int?, bool)

Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.

public Task<SetInspectModeCommandResponse?> SetInspectMode(SetInspectModeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetInspectModeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetInspectModeCommandResponse>

SetPausedInDebuggerMessage(SetPausedInDebuggerMessageCommandSettings, CancellationToken, int?, bool)

setPausedInDebuggerMessage

public Task<SetPausedInDebuggerMessageCommandResponse?> SetPausedInDebuggerMessage(SetPausedInDebuggerMessageCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPausedInDebuggerMessageCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPausedInDebuggerMessageCommandResponse>

SetShowAdHighlights(SetShowAdHighlightsCommandSettings, CancellationToken, int?, bool)

Highlights owner element of all frames detected to be ads.

public Task<SetShowAdHighlightsCommandResponse?> SetShowAdHighlights(SetShowAdHighlightsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowAdHighlightsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowAdHighlightsCommandResponse>

SetShowContainerQueryOverlays(SetShowContainerQueryOverlaysCommandSettings, CancellationToken, int?, bool)

setShowContainerQueryOverlays

public Task<SetShowContainerQueryOverlaysCommandResponse?> SetShowContainerQueryOverlays(SetShowContainerQueryOverlaysCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowContainerQueryOverlaysCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowContainerQueryOverlaysCommandResponse>

SetShowDebugBorders(SetShowDebugBordersCommandSettings, CancellationToken, int?, bool)

Requests that backend shows debug borders on layers

public Task<SetShowDebugBordersCommandResponse?> SetShowDebugBorders(SetShowDebugBordersCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowDebugBordersCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowDebugBordersCommandResponse>

SetShowFPSCounter(SetShowFPSCounterCommandSettings, CancellationToken, int?, bool)

Requests that backend shows the FPS counter

public Task<SetShowFPSCounterCommandResponse?> SetShowFPSCounter(SetShowFPSCounterCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowFPSCounterCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowFPSCounterCommandResponse>

SetShowFlexOverlays(SetShowFlexOverlaysCommandSettings, CancellationToken, int?, bool)

setShowFlexOverlays

public Task<SetShowFlexOverlaysCommandResponse?> SetShowFlexOverlays(SetShowFlexOverlaysCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowFlexOverlaysCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowFlexOverlaysCommandResponse>

SetShowGridOverlays(SetShowGridOverlaysCommandSettings, CancellationToken, int?, bool)

Highlight multiple elements with the CSS Grid overlay.

public Task<SetShowGridOverlaysCommandResponse?> SetShowGridOverlays(SetShowGridOverlaysCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowGridOverlaysCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowGridOverlaysCommandResponse>

SetShowHinge(SetShowHingeCommandSettings, CancellationToken, int?, bool)

Add a dual screen device hinge

public Task<SetShowHingeCommandResponse?> SetShowHinge(SetShowHingeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowHingeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowHingeCommandResponse>

SetShowHitTestBorders(SetShowHitTestBordersCommandSettings, CancellationToken, int?, bool)

Deprecated, no longer has any effect.

public Task<SetShowHitTestBordersCommandResponse?> SetShowHitTestBorders(SetShowHitTestBordersCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowHitTestBordersCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowHitTestBordersCommandResponse>

SetShowInspectedElementAnchor(SetShowInspectedElementAnchorCommandSettings, CancellationToken, int?, bool)

setShowInspectedElementAnchor

public Task<SetShowInspectedElementAnchorCommandResponse?> SetShowInspectedElementAnchor(SetShowInspectedElementAnchorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowInspectedElementAnchorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowInspectedElementAnchorCommandResponse>

SetShowIsolatedElements(SetShowIsolatedElementsCommandSettings, CancellationToken, int?, bool)

Show elements in isolation mode with overlays.

public Task<SetShowIsolatedElementsCommandResponse?> SetShowIsolatedElements(SetShowIsolatedElementsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowIsolatedElementsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowIsolatedElementsCommandResponse>

SetShowLayoutShiftRegions(SetShowLayoutShiftRegionsCommandSettings, CancellationToken, int?, bool)

Requests that backend shows layout shift regions

public Task<SetShowLayoutShiftRegionsCommandResponse?> SetShowLayoutShiftRegions(SetShowLayoutShiftRegionsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowLayoutShiftRegionsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowLayoutShiftRegionsCommandResponse>

SetShowPaintRects(SetShowPaintRectsCommandSettings, CancellationToken, int?, bool)

Requests that backend shows paint rectangles

public Task<SetShowPaintRectsCommandResponse?> SetShowPaintRects(SetShowPaintRectsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowPaintRectsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowPaintRectsCommandResponse>

SetShowScrollBottleneckRects(SetShowScrollBottleneckRectsCommandSettings, CancellationToken, int?, bool)

Requests that backend shows scroll bottleneck rects

public Task<SetShowScrollBottleneckRectsCommandResponse?> SetShowScrollBottleneckRects(SetShowScrollBottleneckRectsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowScrollBottleneckRectsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowScrollBottleneckRectsCommandResponse>

SetShowScrollSnapOverlays(SetShowScrollSnapOverlaysCommandSettings, CancellationToken, int?, bool)

setShowScrollSnapOverlays

public Task<SetShowScrollSnapOverlaysCommandResponse?> SetShowScrollSnapOverlays(SetShowScrollSnapOverlaysCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowScrollSnapOverlaysCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowScrollSnapOverlaysCommandResponse>

SetShowViewportSizeOnResize(SetShowViewportSizeOnResizeCommandSettings, CancellationToken, int?, bool)

Paints viewport size upon main frame resize.

public Task<SetShowViewportSizeOnResizeCommandResponse?> SetShowViewportSizeOnResize(SetShowViewportSizeOnResizeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowViewportSizeOnResizeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowViewportSizeOnResizeCommandResponse>

SetShowWebVitals(SetShowWebVitalsCommandSettings, CancellationToken, int?, bool)

Deprecated, no longer has any effect.

public Task<SetShowWebVitalsCommandResponse?> SetShowWebVitals(SetShowWebVitalsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowWebVitalsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowWebVitalsCommandResponse>

SetShowWindowControlsOverlay(SetShowWindowControlsOverlayCommandSettings, CancellationToken, int?, bool)

Show Window Controls Overlay for PWA

public Task<SetShowWindowControlsOverlayCommandResponse?> SetShowWindowControlsOverlay(SetShowWindowControlsOverlayCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetShowWindowControlsOverlayCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetShowWindowControlsOverlayCommandResponse>

Events

InspectModeCanceled

Fired when user cancels the inspect mode.

public event EventHandler<InspectModeCanceledEventArgs>? InspectModeCanceled

Event Type

EventHandler<InspectModeCanceledEventArgs>

InspectNodeRequested

Fired when the node should be inspected. This happens after call to setInspectMode or when user manually inspects an element.

public event EventHandler<InspectNodeRequestedEventArgs>? InspectNodeRequested

Event Type

EventHandler<InspectNodeRequestedEventArgs>

InspectPanelShowRequested

Fired when user asks to show the Inspect panel.

public event EventHandler<InspectPanelShowRequestedEventArgs>? InspectPanelShowRequested

Event Type

EventHandler<InspectPanelShowRequestedEventArgs>

InspectedElementWindowRestored

Fired when user asks to restore the Inspected Element floating window.

public event EventHandler<InspectedElementWindowRestoredEventArgs>? InspectedElementWindowRestored

Event Type

EventHandler<InspectedElementWindowRestoredEventArgs>

NodeHighlightRequested

Fired when the node should be highlighted. This happens after call to setInspectMode.

public event EventHandler<NodeHighlightRequestedEventArgs>? NodeHighlightRequested

Event Type

EventHandler<NodeHighlightRequestedEventArgs>

ScreenshotRequested

Fired when user asks to capture screenshot of some area on the page.

public event EventHandler<ScreenshotRequestedEventArgs>? ScreenshotRequested

Event Type

EventHandler<ScreenshotRequestedEventArgs>