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:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →