Table of Contents

Class DOMSnapshotAdapter

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

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

public class DOMSnapshotAdapter
Inheritance
DOMSnapshotAdapter
Inherited Members

Constructors

DOMSnapshotAdapter(IDevToolsSession)

Initializes a new instance of the DOMSnapshotAdapter class.

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

CaptureSnapshot(CaptureSnapshotCommandSettings, CancellationToken, int?, bool)

Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.

public Task<CaptureSnapshotCommandResponse> CaptureSnapshot(CaptureSnapshotCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CaptureSnapshotCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CaptureSnapshotCommandResponse>

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

Disables DOM snapshot agent for the given page.

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 DOM snapshot agent for the given page.

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>

GetSnapshot(GetSnapshotCommandSettings, CancellationToken, int?, bool)

Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.

public Task<GetSnapshotCommandResponse> GetSnapshot(GetSnapshotCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetSnapshotCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetSnapshotCommandResponse>