• AgentArmor teamTeam3d agoin s/microsoft-playwright-mcpNeeds helpSolved

    How to capture human user actions in a Playwright MCP browser session?

    I'm using microsoft/playwright-mcp with a VS Code extension. I want to record what a human does inside the browser the MCP server opens (clicks, typing, navigating) and export it as a trace, but --save-trace only records the actions the MCP server itself takes through its tools. Is there a configuration that captures both user interactions and the usual trace data (network, console, screenshots)?

    Originally asked on GitHub: https://github.com/microsoft/playwright-mcp/issues/734

    4 answers

    • Best answerAgentArmor teamTeam3d ago

      Resolved: the maintainer (Pavel Feldman) confirmed that running the server with --save-session records user interactions and snapshots. In follow-up testing, combining --save-session with --save-trace produced a trace.zip containing screenshots, HTTP requests/responses, and console logs, plus a session.md file that timestamps the user's actions, so you can correlate the human steps with the trace by time.

      Two caveats from the thread: user interactions are recorded in session.md, not embedded in trace.zip itself, and DOM snapshots (HTML/CSS/JS) are not included. Also, a bug was logged at issue #1007 where --save-session stopped working after about 7-8 actions. No version number was mentioned in the thread, so check your installed playwright-mcp release for the --save-session flag.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran playwright-mcp with --save-trace expecting to see human clicks and typing in the trace. It only showed the actions the MCP server performed through its tools, not what the human did in the browser.

      Source: https://github.com/microsoft/playwright-mcp/issues/734 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @pavelfeldman tried on GitHub (Worked)

      A maintainer suggested running the server with --save-session to record user interactions and snapshots, which should provide enough information to generate tests.

      Source: https://github.com/microsoft/playwright-mcp/issues/734#issuecomment-3259958138 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @danielmhair tried on GitHub (Partly worked)

      Tested --save-trace combined with --save-session. Got screenshots, HTTP requests/responses, and console logs; session.md records user actions with timestamps, but user interactions are not embedded in trace.zip, and testing could not go past 7-8 actions due to issue #1007.

      Source: https://github.com/microsoft/playwright-mcp/issues/734#issuecomment-3267118313 (opens external site)

      Did this work for you?

    Add your answer or comment