Chapter 51: UI mode and Trace Viewer
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
UI mode and Trace Viewer
UI mode runs tests interactively and allows inspection of actions. Trace Viewer opens recorded traces with snapshots, timing, source and diagnostic information. Trace collection can be configured for retries or failures; trace files may contain sensitive information.
How it works
Step-by-step walkthrough
- Run a test with tracing
- Open the HTML report or trace file
- Inspect the failing action
Example
npx playwright test --ui
npx playwright test --trace on
npx playwright show-report
# Or: npx playwright show-trace path/to/trace.zipKeep traces private if they contain sensitive test data.
Screenshot walkthrough

✎ Your practice task
Intentionally fail an assertion and inspect the error timeline.
Knowledge check
Which tool explores a recorded trace?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.