Debugging Tools in Playwright
From the Playwright cheat sheet ยท Debugging & Trace Viewer ยท verified Jul 2026
Debugging Tools
Use UI mode, trace viewer, and headed mode to debug tests
bash
# Run in UI mode (interactive debugging)
npx playwright test --ui
# Run with browser visible
npx playwright test --headed
# Run with trace recording
npx playwright test --trace on
# View trace file
npx playwright show-trace trace.zip๐ก UI mode is the best debugging experience โ shows DOM snapshots at every step
โก Use page.pause() in your test code to open the Inspector at a specific point
๐ Traces capture screenshots, DOM snapshots, network, and console logs for every action
๐ข Upload trace.zip to trace.playwright.dev to share with teammates โ no install needed
debugtraceui-mode