walkthrough
Back to blog

When to use Playwright and when to pass a recording

Use a live browser to explore and test. Pass selected recording evidence when your agent needs a reference for a specific interaction.

By 2 min read

Two paths: use a live page to explore and test, or select a recorded interaction to hand over focused evidence. Both lead to checks in the target app.
Two paths: use a live page to explore and test, or select a recorded interaction to hand over focused evidence. Both lead to checks in the target app.

Suppose you are adapting a dropdown from a reference site. Your agent needs the observed behaviour to build it, and a running version of your app to test the result.

A recording and a live browser serve different parts of that task.

Playwright is still useful

If the agent needs to open an app, fill a form or check that a dialog closes, it needs a live browser. Playwright is a good fit for that.

The official Playwright guide now makes a useful distinction. It recommends CLI and skills for coding agents that need token-efficient commands. It describes MCP as useful for agent loops that need persistent state and repeated reasoning about the page.

That is a choice about how the agent talks to the browser. It is not a reason to replace every working test.

Choose by the task, not the acronym
You need to…Start withWhy
Run a known regression checkA Playwright testRepeat the same actions and assertions
Let a terminal agent explorePlaywright CLI + skillsSmall commands and on-demand output
Expose browser tools to an MCP clientPlaywright MCPA standard tool connection
Reuse a past interactionSelected recording evidenceKeep the specific moment and captured values

A real complaint, not a benchmark

In a DEV Community learning log, Tohru Yaginuma describes clearing browser-testing context when it is no longer needed. The point is simple: useful context can become old context.

That is one person's experience. It does not prove a fixed token saving for your app. Page size, model, tool version and the number of retries all matter.

There is another problem with cutting output: you can remove the very element reference the agent needs to click. Smaller is only better if the useful information survives.

What we keep in a handoff

For a recorded menu, a useful handoff might contain its trigger, the panel, the selected time, captured styles, and the opening and closing evidence. Add the user's request: keep the motion, but use the target app's colours and components.

It should also say what is missing. An observed click is not proof of every keyboard rule. A replay image is not the original source code.

This is the part Walkthrough works on. It supplies selected recording evidence through exports and MCP. Playwright can then help the agent check the implementation in the target app. They can work together.

Measure the whole job

If you compare tools, keep the model, task and target repo the same. Record the time to an acceptable result, the correction rounds, model usage, and failed checks.

A smaller response that causes three extra retries may be a worse deal. A good-looking result with broken keyboard behaviour is not finished either.

Walkthrough has no published controlled comparison for this task. Use the same acceptance checks for both approaches before drawing a conclusion about time or model usage.

Sources

  1. Playwright: coding agents, CLI and MCPplaywright.dev
  2. Tohru Yaginuma: clearing context after browser tests (individual experience)dev.to
  3. Playwright: Trace Viewerplaywright.dev

Reference links for this article.

Bring one interaction to your app.

Choose a menu or dialog you want to adapt. Capture it in Walkthrough, export the selected evidence to your coding agent, and check the result in your own app.

Open Walkthrough