java.lang.Object
org.openqa.selenium.devtools.v85.debugger.Debugger

public class Debugger extends Object
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
  • Constructor Details

    • Debugger

      public Debugger()
  • Method Details

    • continueToLocation

      public static org.openqa.selenium.devtools.Command<Void> continueToLocation(Location location, Optional<Debugger.ContinueToLocationTargetCallFrames> targetCallFrames)
      Continues execution until specific location is reached.
    • disable

      public static org.openqa.selenium.devtools.Command<Void> disable()
      Disables debugger for given page.
    • enable

      public static org.openqa.selenium.devtools.Command<UniqueDebuggerId> enable(Optional<Number> maxScriptsCacheSize)
      Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
    • evaluateOnCallFrame

      public static org.openqa.selenium.devtools.Command<Debugger.EvaluateOnCallFrameResponse> evaluateOnCallFrame(CallFrameId callFrameId, String expression, Optional<String> objectGroup, Optional<Boolean> includeCommandLineAPI, Optional<Boolean> silent, Optional<Boolean> returnByValue, Optional<Boolean> generatePreview, Optional<Boolean> throwOnSideEffect, Optional<TimeDelta> timeout)
      Evaluates expression on a given call frame.
    • executeWasmEvaluator

      @Beta public static org.openqa.selenium.devtools.Command<Debugger.ExecuteWasmEvaluatorResponse> executeWasmEvaluator(CallFrameId callFrameId, String evaluator, Optional<TimeDelta> timeout)
      Execute a Wasm Evaluator module on a given call frame.
    • getPossibleBreakpoints

      public static org.openqa.selenium.devtools.Command<List<BreakLocation>> getPossibleBreakpoints(Location start, Optional<Location> end, Optional<Boolean> restrictToFunction)
      Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
    • getScriptSource

      public static org.openqa.selenium.devtools.Command<Debugger.GetScriptSourceResponse> getScriptSource(ScriptId scriptId)
      Returns source for the script with given id.
    • getWasmBytecode

      @Deprecated public static org.openqa.selenium.devtools.Command<String> getWasmBytecode(ScriptId scriptId)
      Deprecated.
      This command is deprecated. Use getScriptSource instead.
    • getStackTrace

      @Beta public static org.openqa.selenium.devtools.Command<StackTrace> getStackTrace(StackTraceId stackTraceId)
      Returns stack trace with given `stackTraceId`.
    • pause

      public static org.openqa.selenium.devtools.Command<Void> pause()
      Stops on the next JavaScript statement.
    • pauseOnAsyncCall

      @Beta @Deprecated public static org.openqa.selenium.devtools.Command<Void> pauseOnAsyncCall(StackTraceId parentStackTraceId)
      Deprecated.
    • removeBreakpoint

      public static org.openqa.selenium.devtools.Command<Void> removeBreakpoint(BreakpointId breakpointId)
      Removes JavaScript breakpoint.
    • restartFrame

      public static org.openqa.selenium.devtools.Command<Debugger.RestartFrameResponse> restartFrame(CallFrameId callFrameId)
      Restarts particular call frame from the beginning.
    • resume

      public static org.openqa.selenium.devtools.Command<Void> resume(Optional<Boolean> terminateOnResume)
      Resumes JavaScript execution.
    • searchInContent

      public static org.openqa.selenium.devtools.Command<List<SearchMatch>> searchInContent(ScriptId scriptId, String query, Optional<Boolean> caseSensitive, Optional<Boolean> isRegex)
      Searches for given string in script content.
    • setAsyncCallStackDepth

      public static org.openqa.selenium.devtools.Command<Void> setAsyncCallStackDepth(Integer maxDepth)
      Enables or disables async call stacks tracking.
    • setBlackboxPatterns

      @Beta public static org.openqa.selenium.devtools.Command<Void> setBlackboxPatterns(List<String> patterns)
      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.
    • setBlackboxedRanges

      @Beta public static org.openqa.selenium.devtools.Command<Void> setBlackboxedRanges(ScriptId scriptId, List<ScriptPosition> positions)
      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.
    • setBreakpoint

      public static org.openqa.selenium.devtools.Command<Debugger.SetBreakpointResponse> setBreakpoint(Location location, Optional<String> condition)
      Sets JavaScript breakpoint at a given location.
    • setInstrumentationBreakpoint

      public static org.openqa.selenium.devtools.Command<BreakpointId> setInstrumentationBreakpoint(Debugger.SetInstrumentationBreakpointInstrumentation instrumentation)
      Sets instrumentation breakpoint.
    • setBreakpointByUrl

      public static org.openqa.selenium.devtools.Command<Debugger.SetBreakpointByUrlResponse> setBreakpointByUrl(Integer lineNumber, Optional<String> url, Optional<String> urlRegex, Optional<String> scriptHash, Optional<Integer> columnNumber, Optional<String> condition)
      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.
    • setBreakpointOnFunctionCall

      @Beta public static org.openqa.selenium.devtools.Command<BreakpointId> setBreakpointOnFunctionCall(RemoteObjectId objectId, Optional<String> condition)
      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.
    • setBreakpointsActive

      public static org.openqa.selenium.devtools.Command<Void> setBreakpointsActive(Boolean active)
      Activates / deactivates all breakpoints on the page.
    • setPauseOnExceptions

      public static org.openqa.selenium.devtools.Command<Void> setPauseOnExceptions(Debugger.SetPauseOnExceptionsState state)
      Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is `none`.
    • setReturnValue

      @Beta public static org.openqa.selenium.devtools.Command<Void> setReturnValue(CallArgument newValue)
      Changes return value in top frame. Available only at return break position.
    • setScriptSource

      public static org.openqa.selenium.devtools.Command<Debugger.SetScriptSourceResponse> setScriptSource(ScriptId scriptId, String scriptSource, Optional<Boolean> dryRun)
      Edits JavaScript source live.
    • setSkipAllPauses

      public static org.openqa.selenium.devtools.Command<Void> setSkipAllPauses(Boolean skip)
      Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
    • setVariableValue

      public static org.openqa.selenium.devtools.Command<Void> setVariableValue(Integer scopeNumber, String variableName, CallArgument newValue, CallFrameId callFrameId)
      Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
    • stepInto

      public static org.openqa.selenium.devtools.Command<Void> stepInto(Optional<Boolean> breakOnAsyncCall)
      Steps into the function call.
    • stepOut

      public static org.openqa.selenium.devtools.Command<Void> stepOut()
      Steps out of the function call.
    • stepOver

      public static org.openqa.selenium.devtools.Command<Void> stepOver()
      Steps over the statement.
    • breakpointResolved

      public static org.openqa.selenium.devtools.Event<BreakpointResolved> breakpointResolved()
    • paused

      public static org.openqa.selenium.devtools.Event<Paused> paused()
    • resumed

      public static org.openqa.selenium.devtools.Event<Void> resumed()
    • scriptFailedToParse

      public static org.openqa.selenium.devtools.Event<ScriptFailedToParse> scriptFailedToParse()
    • scriptParsed

      public static org.openqa.selenium.devtools.Event<ScriptParsed> scriptParsed()