Spec-Zone.ru › Playwright

Debugger

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​

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

Usage

await debugger.next();

Returns

  • Promise<void>

pausedDetails​

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

Usage

debugger.pausedDetails();

Returns

  • null | Object
    • location Object

      • file string

      • line number (optional)

      • column number (optional)

    • title string

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

await debugger.requestPause();

Returns

  • Promise<void>

resume​

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

Usage

await debugger.resume();

Returns

  • Promise<void>

runTo​

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

Usage

await debugger.runTo(location);

Arguments

  • location Object

    • file string

    • line number (optional)

    • column number (optional)

    The source location to pause at.

Returns

  • Promise<void>

Events​

on('pausedstatechanged')​

Emitted when the debugger pauses or resumes.

Usage

debugger.on('pausedstatechanged', data => {});

© 2026 Microsoft
Licensed under the Apache License, Version 2.0.
https://playwright.dev/docs/api/class-debugger

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API