Table of Contents

Class DebuggerAdapter

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

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

public class DebuggerAdapter
Inheritance
DebuggerAdapter
Inherited Members

Constructors

DebuggerAdapter(IDevToolsSession)

Initializes a new instance of the DebuggerAdapter class.

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

ContinueToLocation(ContinueToLocationCommandSettings, CancellationToken, int?, bool)

Continues execution until specific location is reached.

public Task<ContinueToLocationCommandResponse?> ContinueToLocation(ContinueToLocationCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ContinueToLocationCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ContinueToLocationCommandResponse>

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

Disables debugger for 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>

DisassembleWasmModule(DisassembleWasmModuleCommandSettings, CancellationToken, int?, bool)

disassembleWasmModule

public Task<DisassembleWasmModuleCommandResponse> DisassembleWasmModule(DisassembleWasmModuleCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisassembleWasmModuleCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisassembleWasmModuleCommandResponse>

Enable(EnableCommandSettings, CancellationToken, int?, bool)

Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.

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>

EvaluateOnCallFrame(EvaluateOnCallFrameCommandSettings, CancellationToken, int?, bool)

Evaluates expression on a given call frame.

public Task<EvaluateOnCallFrameCommandResponse> EvaluateOnCallFrame(EvaluateOnCallFrameCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EvaluateOnCallFrameCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EvaluateOnCallFrameCommandResponse>

GetPossibleBreakpoints(GetPossibleBreakpointsCommandSettings, CancellationToken, int?, bool)

Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.

public Task<GetPossibleBreakpointsCommandResponse> GetPossibleBreakpoints(GetPossibleBreakpointsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetPossibleBreakpointsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetPossibleBreakpointsCommandResponse>

GetScriptSource(GetScriptSourceCommandSettings, CancellationToken, int?, bool)

Returns source for the script with given id.

public Task<GetScriptSourceCommandResponse> GetScriptSource(GetScriptSourceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetScriptSourceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetScriptSourceCommandResponse>

GetStackTrace(GetStackTraceCommandSettings, CancellationToken, int?, bool)

Returns stack trace with given stackTraceId.

public Task<GetStackTraceCommandResponse> GetStackTrace(GetStackTraceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetStackTraceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetStackTraceCommandResponse>

GetWasmBytecode(GetWasmBytecodeCommandSettings, CancellationToken, int?, bool)

This command is deprecated. Use getScriptSource instead.

public Task<GetWasmBytecodeCommandResponse> GetWasmBytecode(GetWasmBytecodeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetWasmBytecodeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetWasmBytecodeCommandResponse>

NextWasmDisassemblyChunk(NextWasmDisassemblyChunkCommandSettings, CancellationToken, int?, bool)

Disassemble the next chunk of lines for the module corresponding to the stream. If disassembly is complete, this API will invalidate the streamId and return an empty chunk. Any subsequent calls for the now invalid stream will return errors.

public Task<NextWasmDisassemblyChunkCommandResponse> NextWasmDisassemblyChunk(NextWasmDisassemblyChunkCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command NextWasmDisassemblyChunkCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<NextWasmDisassemblyChunkCommandResponse>

Pause(PauseCommandSettings?, CancellationToken, int?, bool)

Stops on the next JavaScript statement.

public Task<PauseCommandResponse?> Pause(PauseCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command PauseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<PauseCommandResponse>

PauseOnAsyncCall(PauseOnAsyncCallCommandSettings, CancellationToken, int?, bool)

pauseOnAsyncCall

public Task<PauseOnAsyncCallCommandResponse?> PauseOnAsyncCall(PauseOnAsyncCallCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command PauseOnAsyncCallCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<PauseOnAsyncCallCommandResponse>

RemoveBreakpoint(RemoveBreakpointCommandSettings, CancellationToken, int?, bool)

Removes JavaScript breakpoint.

public Task<RemoveBreakpointCommandResponse?> RemoveBreakpoint(RemoveBreakpointCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveBreakpointCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveBreakpointCommandResponse>

RestartFrame(RestartFrameCommandSettings, CancellationToken, int?, bool)

Restarts particular call frame from the beginning. The old, deprecated behavior of restartFrame is to stay paused and allow further CDP commands after a restart was scheduled. This can cause problems with restarting, so we now continue execution immediatly after it has been scheduled until we reach the beginning of the restarted frame.

To stay back-wards compatible, restartFrame now expects a mode parameter to be present. If the mode parameter is missing, restartFrame errors out.

The various return values are deprecated and callFrames is always empty. Use the call frames from the Debugger#paused events instead, that fires once V8 pauses at the beginning of the restarted function.

public Task<RestartFrameCommandResponse> RestartFrame(RestartFrameCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RestartFrameCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RestartFrameCommandResponse>

Resume(ResumeCommandSettings, CancellationToken, int?, bool)

Resumes JavaScript execution.

public Task<ResumeCommandResponse?> Resume(ResumeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ResumeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ResumeCommandResponse>

SearchInContent(SearchInContentCommandSettings, CancellationToken, int?, bool)

Searches for given string in script content.

public Task<SearchInContentCommandResponse> SearchInContent(SearchInContentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SearchInContentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SearchInContentCommandResponse>

SetAsyncCallStackDepth(SetAsyncCallStackDepthCommandSettings, CancellationToken, int?, bool)

Enables or disables async call stacks tracking.

public Task<SetAsyncCallStackDepthCommandResponse?> SetAsyncCallStackDepth(SetAsyncCallStackDepthCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAsyncCallStackDepthCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAsyncCallStackDepthCommandResponse>

SetBlackboxExecutionContexts(SetBlackboxExecutionContextsCommandSettings, CancellationToken, int?, bool)

Replace previous blackbox execution contexts with passed ones. Forces backend to skip stepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.

public Task<SetBlackboxExecutionContextsCommandResponse?> SetBlackboxExecutionContexts(SetBlackboxExecutionContextsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBlackboxExecutionContextsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBlackboxExecutionContextsCommandResponse>

SetBlackboxPatterns(SetBlackboxPatternsCommandSettings, CancellationToken, int?, bool)

Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.

public Task<SetBlackboxPatternsCommandResponse?> SetBlackboxPatterns(SetBlackboxPatternsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBlackboxPatternsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBlackboxPatternsCommandResponse>

SetBlackboxedRanges(SetBlackboxedRangesCommandSettings, CancellationToken, int?, bool)

Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted.

public Task<SetBlackboxedRangesCommandResponse?> SetBlackboxedRanges(SetBlackboxedRangesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBlackboxedRangesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBlackboxedRangesCommandResponse>

SetBreakpoint(SetBreakpointCommandSettings, CancellationToken, int?, bool)

Sets JavaScript breakpoint at a given location.

public Task<SetBreakpointCommandResponse> SetBreakpoint(SetBreakpointCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBreakpointCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBreakpointCommandResponse>

SetBreakpointByUrl(SetBreakpointByUrlCommandSettings, CancellationToken, int?, bool)

Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.

public Task<SetBreakpointByUrlCommandResponse> SetBreakpointByUrl(SetBreakpointByUrlCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBreakpointByUrlCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBreakpointByUrlCommandResponse>

SetBreakpointOnFunctionCall(SetBreakpointOnFunctionCallCommandSettings, CancellationToken, int?, bool)

Sets JavaScript breakpoint before each call to the given function. If another function was created from the same source as a given one, calling it will also trigger the breakpoint.

public Task<SetBreakpointOnFunctionCallCommandResponse> SetBreakpointOnFunctionCall(SetBreakpointOnFunctionCallCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBreakpointOnFunctionCallCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBreakpointOnFunctionCallCommandResponse>

SetBreakpointsActive(SetBreakpointsActiveCommandSettings, CancellationToken, int?, bool)

Activates / deactivates all breakpoints on the page.

public Task<SetBreakpointsActiveCommandResponse?> SetBreakpointsActive(SetBreakpointsActiveCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBreakpointsActiveCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBreakpointsActiveCommandResponse>

SetInstrumentationBreakpoint(SetInstrumentationBreakpointCommandSettings, CancellationToken, int?, bool)

Sets instrumentation breakpoint.

public Task<SetInstrumentationBreakpointCommandResponse> SetInstrumentationBreakpoint(SetInstrumentationBreakpointCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetInstrumentationBreakpointCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetInstrumentationBreakpointCommandResponse>

SetPauseOnExceptions(SetPauseOnExceptionsCommandSettings, CancellationToken, int?, bool)

Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions, or caught exceptions, no exceptions. Initial pause on exceptions state is none.

public Task<SetPauseOnExceptionsCommandResponse?> SetPauseOnExceptions(SetPauseOnExceptionsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPauseOnExceptionsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPauseOnExceptionsCommandResponse>

SetReturnValue(SetReturnValueCommandSettings, CancellationToken, int?, bool)

Changes return value in top frame. Available only at return break position.

public Task<SetReturnValueCommandResponse?> SetReturnValue(SetReturnValueCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetReturnValueCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetReturnValueCommandResponse>

SetScriptSource(SetScriptSourceCommandSettings, CancellationToken, int?, bool)

Edits JavaScript source live.

In general, functions that are currently on the stack can not be edited with a single exception: If the edited function is the top-most stack frame and that is the only activation of that function on the stack. In this case the live edit will be successful and a Debugger.restartFrame for the top-most function is automatically triggered.

public Task<SetScriptSourceCommandResponse> SetScriptSource(SetScriptSourceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetScriptSourceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetScriptSourceCommandResponse>

SetSkipAllPauses(SetSkipAllPausesCommandSettings, CancellationToken, int?, bool)

Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

public Task<SetSkipAllPausesCommandResponse?> SetSkipAllPauses(SetSkipAllPausesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSkipAllPausesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSkipAllPausesCommandResponse>

SetVariableValue(SetVariableValueCommandSettings, CancellationToken, int?, bool)

Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.

public Task<SetVariableValueCommandResponse?> SetVariableValue(SetVariableValueCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetVariableValueCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetVariableValueCommandResponse>

StepInto(StepIntoCommandSettings, CancellationToken, int?, bool)

Steps into the function call.

public Task<StepIntoCommandResponse?> StepInto(StepIntoCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StepIntoCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StepIntoCommandResponse>

StepOut(StepOutCommandSettings?, CancellationToken, int?, bool)

Steps out of the function call.

public Task<StepOutCommandResponse?> StepOut(StepOutCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StepOutCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StepOutCommandResponse>

StepOver(StepOverCommandSettings, CancellationToken, int?, bool)

Steps over the statement.

public Task<StepOverCommandResponse?> StepOver(StepOverCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StepOverCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StepOverCommandResponse>

Events

BreakpointResolved

Fired when breakpoint is resolved to an actual script and location. Deprecated in favor of resolvedBreakpoints in the scriptParsed event.

public event EventHandler<BreakpointResolvedEventArgs>? BreakpointResolved

Event Type

EventHandler<BreakpointResolvedEventArgs>

Paused

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

public event EventHandler<PausedEventArgs>? Paused

Event Type

EventHandler<PausedEventArgs>

Resumed

Fired when the virtual machine resumed execution.

public event EventHandler<ResumedEventArgs>? Resumed

Event Type

EventHandler<ResumedEventArgs>

ScriptFailedToParse

Fired when virtual machine fails to parse the script.

public event EventHandler<ScriptFailedToParseEventArgs>? ScriptFailedToParse

Event Type

EventHandler<ScriptFailedToParseEventArgs>

ScriptParsed

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

public event EventHandler<ScriptParsedEventArgs>? ScriptParsed

Event Type

EventHandler<ScriptParsedEventArgs>