Skip to content

Latest commit

 

History

History
224 lines (157 loc) · 9.46 KB

File metadata and controls

224 lines (157 loc) · 9.46 KB
id class-debugger
title Debugger

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard';

API for controlling the Playwright debugger. The debugger allows pausing script execution and inspecting the page. Obtain the debugger instance via BrowserContext.debugger().


Methods

next {#debugger-next}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.next

Resumes script execution and pauses again before the next action. Throws if the debugger is not paused.

Usage

Debugger.next();

Returns


pausedDetails {#debugger-paused-details}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.pausedDetails

Returns details about the currently paused call. Returns null if the debugger is not paused.

Usage

Debugger.pausedDetails();

Returns


requestPause {#debugger-request-pause}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.requestPause

Configures the debugger to pause before the next action is executed.

Throws if the debugger is already paused. Use Debugger.next() or Debugger.runTo() to step while paused.

Note that Page.pause() is equivalent to a "debugger" statement — it pauses execution at the call site immediately. On the contrary, Debugger.requestPause() is equivalent to "pause on next statement" — it configures the debugger to pause before the next action is executed.

Usage

Debugger.requestPause();

Returns


resume {#debugger-resume}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.resume

Resumes script execution. Throws if the debugger is not paused.

Usage

Debugger.resume();

Returns


runTo {#debugger-run-to}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.runTo

Resumes script execution and pauses when an action originates from the given source location. Throws if the debugger is not paused.

Usage

Debugger.runTo(location);

Arguments

  • location Location#

    • setFile String

    • setLine int (optional)

    • setColumn int (optional)

    The source location to pause at.

Returns


Events

onPausedStateChanged(handler) {#debugger-event-paused-state-changed}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.onPausedStateChanged(handler)

Emitted when the debugger pauses or resumes.

Usage

Debugger.onPausedStateChanged(handler)