Config and CI
Trace Viewer in Playwright
Use Playwright Trace Viewer to inspect actions, DOM snapshots, network calls, console logs, screenshots, and failures after a test run.
What Trace Viewer Shows
- Action timeline.
- Before and after DOM snapshots.
- Locator resolution details.
- Network requests and responses.
- Console messages and errors.
- Screenshots and attachments.
How to Enable Trace
// playwright.config.ts
use: {
trace: 'on-first-retry'
}How to Open Trace
npx playwright show-trace trace.zipReading the Trace
- Start from the failed action.
- Check the locator snapshot.
- Look at the page before the action.
- Review console and network panels.
- Confirm whether the problem is test code, data, timing, or application behavior.
Debugging Failed Tests
Trace Viewer is strongest when you use it to answer one question: what did Playwright try to do, and what did the browser actually show at that moment?