Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

With Playwright CLI

Record what an agent did with Playwright CLI, with a trace, video, screenshots and page snapshots, and share it as a Currents session

Playwright CLI (playwright-cli) drives a browser from shell commands, so any agent with a shell can use it. When the agent records the browser while it works, you can check what it did: the screenshots, the video, the trace of every click and request, and the page text. Save the recording to Currents as a session, and you get one link to all of it.

What you need

Record a browser session

Start a Currents session, record with Playwright CLI, then attach the files and share the session:

npx currents session start --project-id <project-id> --title "Lowercase discount code applies 10% off" --status passed

playwright-cli open
playwright-cli tracing-start
playwright-cli video-start
playwright-cli goto http://localhost:3000/
playwright-cli snapshot
# ... fill, click and other commands
playwright-cli snapshot --filename=discount-applied-a11y.yml
playwright-cli screenshot --filename=discount-applied.png
playwright-cli video-stop
playwright-cli tracing-stop
playwright-cli close

npx currents session attach discount-applied.png discount-applied-a11y.yml .playwright-cli/traces
npx currents session share
  • snapshot saves the page's accessibility tree, with its text, as a .yml file.

  • session attach packs the .playwright-cli/traces folder into one trace. The video is also in .playwright-cli: attach it by name.

  • Attach only the files you name. Do not attach the whole .playwright-cli folder: it holds the browser's storage state, with cookies, and anyone with the link could read it.

  • Empty .playwright-cli/traces before each recording. Two recordings at once write to the same folder, and session attach would pack their traces together.

A terminal running the commands above: currents session start, the playwright-cli commands and their output, currents session attach, and share, which prints the session link

To have an agent do these steps, give it a Currents skill. See Record a bug and its fix.

What you get

The session page puts the screenshot, video, trace, page snapshot and console log on one timeline:

A session recorded with Playwright CLI on the Timeline view: rows for screenshots, videos, traces, and text and logs, with the video open below

Last updated

Was this helpful?