Skip to content

v1.12.0

Compare
Choose a tag to compare
@aslushnikov aslushnikov released this 09 Jun 01:04
44f3553

🧟‍♂️ Introducing Playwright Trace & TraceViewer

Playwright Trace Viewer is a new GUI tool that helps exploring recorded Playwright traces after the script ran. Playwright traces let you examine:

  • page DOM before and after each Playwright action
  • page rendering before and after each Playwright action
  • browser network during script execution

Traces are recorded using the new BrowserContext.tracing() API:

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

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

Page page = context.newPage();
page.goto("https://playwright.dev");

// Stop tracing and export it into a zip archive.
context.tracing.stop(new Tracing.StopOptions()
  .setPath(Paths.get("trace.zip")));

Traces are examined later with the Playwright CLI:

mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="show-trace trace.zip"

That will open the following GUI:

image

👉 Read more in trace viewer documentation.


Browser Versions

  • Chromium 93.0.4530.0
  • Mozilla Firefox 89.0
  • WebKit 14.2

This version of Playwright was also tested against the following stable channels:

  • Google Chrome 91
  • Microsoft Edge 91

New APIs