Skip to main content

Trace viewer


Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has ran. Traces are a great way for debugging your tests when they fail on CI. You can open traces locally or in your browser on

Trace Viewer features


In the Actions tab you can see what locator was used for every action and how long each one took to run. Hover over each action of your test and visually see the change in the DOM snapshot. Go back and forward in time and click an action to inspect and debug. Use the Before and After tabs to visually see what happened before and after the action.

actions tab in trace viewer

Selecting each action reveals:

  • action snapshots
  • action log
  • source code location


When tracing with the screenshots option turned on, each trace records a screencast and renders it as a film strip. You can hover over the film strip to see a magnified image of for each action and state which helps you easily find the action you want to inspect.

Double click on an action to see the time range for that action. You can use the slider in the timeline to increase the actions selected and these will be shown in the Actions tab and all console logs and network logs will be filtered to only show the logs for the actions selected.

timeline view in trace viewer


When tracing with the snapshots option turned on (default), Playwright captures a set of complete DOM snapshots for each action. Depending on the type of the action, it will capture:

BeforeA snapshot at the time action is called.
ActionA snapshot at the moment of the performed input. This type of snapshot is especially useful when exploring where exactly Playwright clicked.
AfterA snapshot after the action.

Here is what the typical Action snapshot looks like:

action tab in trace viewer

Notice how it highlights both, the DOM Node as well as the exact click position.


As you hover over each action of your test the line of code for that action is highlighted in the source panel.

showing source code tab in trace viewer


The call tab shows you information about the action such as the time it took, what locator was used, if in strict mode and what key was used.

showing call tab in trace viewer


See a full log of your test to better understand what Playwright is doing behind the scenes such as scrolling into view, waiting for element to be visible, enabled and stable and performing actions such as click, fill, press etc.

showing log of tests in trace viewer


If your test fails you will see the error messages for each test in the Errors tab. The timeline will also show a red line highlighting where the error occurred. You can also click on the source tab to see on which line of the source code the error is.

showing errors in trace viewer


See console logs from the browser as well as from your test. Different icons are displayed to show you if the console log came from the browser or from the test file.

showing log of tests in trace viewer


The Network tab shows you all the network requests that were made during your test. You can sort by different types of requests, status code, method, request, content type, duration and size. Click on a request to see more information about it such as the request headers, response headers, request body and response body.

network requests tab in trace viewer


Next to the Actions tab you will find the Metadata tab which will show you more information on your test such as the Browser, viewport size, test duration and more.

meta data in trace viewer

Recording a trace

Traces can be recorded using the BrowserContext.tracing() API as follows:

Browser browser = browserType.launch();
BrowserContext context = browser.newContext();

// Start tracing before creating / navigating a page.
context.tracing().start(new Tracing.StartOptions()

Page page = context.newPage();

// Stop tracing and export it into a zip archive.
context.tracing().stop(new Tracing.StopOptions()

This will record the trace and place it into the file named

Opening the trace

You can open the saved trace using the Playwright CLI or in your browser on Make sure to add the full path to where your file is located.

mvn exec:java -e -D -D exec.args="show-trace"

Using is a statically hosted variant of the Trace Viewer. You can upload trace files using drag and drop.

Drop Playwright Trace to load

Viewing remote traces

You can open remote traces using it's URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file.

mvn exec:java -e -D -D exec.args="show-trace"

You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply.