Specnote
Back to the blog
playwright trace viewerPlaywrightE2E testingconceptSpecnote

What is Playwright trace viewer? What is left when a test fails

By WonyoungAugust 21, 20265 min
On this page

A test failed. What you get is the fact that it failed and a few lines of error text. To find the cause from that, someone has to recreate the same situation and click through it again. Playwright trace viewer exists to remove that step. It records everything that happened during the run so you can rewind to the moment it failed.

Key takeaways

Playwright trace viewer records actions, DOM snapshots, network calls and console output during a run. After a failure you rewind to that exact moment instead of reproducing it. Reading the trace still requires reading code, and deciding what counts as a failure is still a person's job.

"It failed" is not enough to fix anything

When an automated test fails, what you actually need is this.

  • Which step stopped
  • What the page looked like at that moment
  • Whether the element it tried to click was on the page
  • Whether the server responded correctly

A few log lines answer none of these. So you rerun the failing test, open the page, click through it, and when that does not work you add logging and run it again. The time spent reproducing often exceeds the time spent fixing.

That gap is widest in CI. When something passes locally and stops only on the runner, logs are all you have, and logs are not much. This connects to the maintenance problem covered in the locators post.

What Playwright trace viewer records

A trace captures the run into a single file. The Playwright documentation describes it as being able to "go back and forward through each action of your test and visually see what was happening during each action."

Here is what lands in it.

RecordedWhat it tells you
ActionsEvery click, fill and navigation in order
DOM snapshotsThe page immediately before and after each action
SourceWhich line of the test was running
NetworkWhich requests went out and which failed
ConsoleErrors the page logged
TimelineHow long each step took

The important part is that the page state is not a screenshot. It holds the DOM of that moment, so you can open it, hover elements and inspect them. A failed page becomes something you can investigate later.

The six things Playwright trace viewer keepsA trace keeps actions, DOM snapshots, source, network, console and timing together

Turning it on

It is one line in the default config.

playwright.config.ts
export default defineConfig({
  retries: process.env.CI ? 2 : 0,
  use: {
    trace: 'on-first-retry',
  },
});

on-first-retry records only when a test failed once and is being retried. Recording everything piles up files and slows the suite, so the default turns it on exactly when it matters.

To capture one right now, turn it on for the run.

npx playwright test --trace on

Opening the Playwright report

After the run, open the report.

npx playwright show-report

Failed tests carry a trace icon. Click it and the trace viewer opens: the action list runs down the left, picking one shows the page at that moment in the middle, and the timeline across the top shows which stretch took longest.

Failures from CI open the same way. Download the artifact, unzip it and run the same command, and you can rewind what happened on the runner from your own machine.

Playwright debugging without reproducing

What the trace viewer changes is the shape of the investigation.

Before, a failure had to be recreated before it could be investigated. Same conditions, same sequence, and if you were unlucky the situation never came back and you gave up. Intermittent failures were the worst of it.

With a trace, the failure is already recorded. There is nothing to recreate. Open it, move to the moment it stopped, and look at what was and was not on the page.

Investigating a failure with and without a traceWith a trace you investigate a failure without reproducing it

This is something Playwright did particularly well. Most test tools leave an error message and one screenshot. This leaves the moment itself in a form you can examine.

What still remains

A record existing and someone reading it are two different things.

First, reading it takes code. The trace viewer shows which line of the test did what. Without reading code you get an action list and some pictures, and that rarely reaches a cause.

Second, nobody owns opening it. If a suite fails overnight in CI, the trace is there. Who opens it in the morning is not something the tool decides. In teams where failures sit for days, what is missing is not the record but the routine after it.

Third, what counts as a failure is still yours to define. A trace records what happened. Whether that page was the intended state is not written anywhere in it.

Specnote fills that gap differently

Specnote makes what remains after a failure readable without code. It replays the run as video showing where it stopped and what the screen looked like, and states in plain language what went wrong. Because the approved scope is the standard, what counts as a failure was settled in advance.

If you can read and edit code, the trace viewer is more precise — request by request, line by line, nothing beats it. What we aim at is the case where opening that view does not help because nobody can read it.

Keep readingWhat Is Playwright MCP? 7 Strengths and 3 Ways to Chooseplaywright mcpplaywright8 min

Technical details in this post were verified against the Playwright documentation on Trace viewer on August 21, 2026.

Frequently asked questions

  • What is Playwright trace viewer?

    It collects the actions, page states, network calls and console output of a test run into one file you can rewind afterward. It lets you investigate a failure without reproducing it.

  • Should I just leave tracing on?

    You can, but the default records only on the first retry. Always-on tracing accumulates files and slows the suite. If you are chasing a specific cause, --trace on for that run is the better move.

  • How is this different from saving screenshots?

    A screenshot is one picture of one moment. A trace keeps the DOM, so you can open it and inspect elements. That difference is what makes a failed page investigable later.

  • Can I see failures that happened in CI?

    Yes. Download the run artifact, unzip it and open the report, and you can rewind what happened on the runner. The default workflow keeps artifacts for 30 days.

  • Is it usable if I cannot read code?

    You can see the action list and page states. Finding the cause means reading which line did what, so there is a wall for people who do not work in the code. > [!CTA] > Get failures back as video > > We replay where the run stopped and state what went wrong in plain language. No code to read. > > Start free

Keep reading

If you enjoyed this post