lecture 17 of 200 completed

Traces, screenshots and video

The trace viewer is Playwright's best feature. It records the run so completely you can debug a failure you never saw.

What you'll learn

  • What a trace records, and why it beats a screenshot
  • How to turn traces on without slowing every run
  • How to read one when a test failed and you did not watch

A test fails on the build server at three in the morning. It passes on your machine every time. In most tools this is where you start adding logs and guessing.

Playwright records the whole run, and the recording is good enough that guessing is usually unnecessary. This is the feature that most convinces teams to switch, so it is worth understanding properly.

Turn it on in playwright.config.ts:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →