| 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 browser_context.debugger.
<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
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.request_pause
Configures the debugger to pause before the next action is executed.
Throws if the debugger is already paused. Use debugger.next() or debugger.run_to() 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.request_pause() is equivalent to "pause on next statement" — it configures the debugger to pause before the next action is executed.
Usage
debugger.request_pause()Returns
<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
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.run_to
Resumes script execution and pauses when an action originates from the given source location. Throws if the debugger is not paused.
Usage
debugger.run_to(location)Arguments
Returns
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.paused_details
Returns details about the currently paused call. Returns null if the debugger is not paused.
Usage
debugger.paused_detailsReturns
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59debugger.on("pausedstatechanged")
Emitted when the debugger pauses or resumes.
Usage
debugger.on("pausedstatechanged", handler)