WindowsmacOSLinux

Where Does Playwright Save Traces and Videos?

Playwright writes traces, screenshots, and videos into test-results in your project, controlled by the trace option.

Last updated

Playwright Test drops its artifacts in the test output directory, test-results by default, next to blob reports and the HTML report data. Traces land as trace.zip files you open with npx playwright show-trace.

Recording is off unless you ask. The trace option decides what gets kept: off records nothing, on keeps everything, retain-on-failure and on-first-retry keep only the interesting runs. Screenshots and video follow the same modes through their own options, so set all three together.

Where Playwright stores this, by platform

Windows
<project>\test-results\*.trace.zip

Default outputDir for the test runner. Change it with outputDir in playwright.config. Open any trace with npx playwright show-trace <file>. Videos and screenshots from the same run sit beside the trace.

macOS
<project>/test-results/*.trace.zip

Same default as Windows and Linux. Enable tracing in the config with use: { trace: 'on-first-retry' } or record manually with context.tracing and a stop path of your choosing.

Linux
<project>/test-results/*.trace.zip

Same default. In CI, upload test-results (or blob-report plus traces) as artifacts before the next run overwrites them. Live traces also stream into traces/ inside the output directory during execution.

Frequently asked questions

No trace files appear after my Playwright run. Why?

Tracing defaults to off. Set trace in playwright.config, for example 'retain-on-failure' to keep traces only for failed tests, or 'on' to keep everything. Passing tests with retain modes leave no trace behind by design.

How do I open a Playwright trace file?

Run npx playwright show-trace against the trace.zip, or upload it to the online Trace Viewer. The viewer shows the timeline, DOM snapshots, network log, console output, and screenshots per action.

Notice an outdated path? Let us know.