Testing / Playwright Interview questions
What is the Trace Viewer in Playwright?
The Trace Viewer is a post-mortem debugging tool that replays exactly what happened during a test run, using a single recorded trace.zip file. It captures a DOM snapshot, screenshot, network activity, and console logs for every action, and lets you scrub through them like a timeline rather than guessing from log lines.
# in playwright.config.ts: trace: 'on-first-retry' npx playwright show-trace trace.zip
Because tracing captures full DOM snapshots rather than just images, you can inspect the actual rendered HTML at the moment of failure, hover over elements, and even see which locator Playwright resolved to. Setting trace: 'on-first-retry' is the common CI setting - it keeps overhead low while still capturing detail exactly when a test starts to look flaky.
More Related questions...