Autonomous Exploratory Testing with Playwright CLI and AI Agents
You cannot be in two places at once. But your AI agent can.
Learn how to use AI agents with Playwright CLI to do exploratory testing, while you are working in parallel on something more fun.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿง  ๐–๐ก๐š๐ญ ๐๐จ๐ž๐ฌ ๐ก๐ฎ๐ฆ๐š๐ง ๐ž๐ฑ๐ฉ๐ฅ๐จ๐ซ๐š๐ญ๐จ๐ซ๐ฒ ๐ญ๐ž๐ฌ๐ญ๐ข๐ง๐  ๐ฅ๐จ๐จ๐ค ๐ฅ๐ข๐ค๐ž?
A tester:
โˆ™ Thinks about what to try next
โˆ™ Clicks, observes, and takes notes
โˆ™ Stops when something blocks them
โˆ™ Hands findings to the team
Playwright CLI + AI coding agent can do the same. Completely autonomously.
And you can set it up and configure it in 30 minutes, then send it to work for hours.
โš™๏ธ ๐‡๐ž๐ซ๐ž ๐ข๐ฌ ๐ญ๐ก๐ž ๐ฌ๐ž๐ญ๐ฎ๐ฉ:
You need to create only 1 file `๐ฌ๐ญ๐ž๐ฉ๐ฌ.๐ฆ๐` that defines the mission and the rules for the agent:
  • How to use Playwright CLI
  • Start URL (and environment)
  • Scope. What area or flow to explore:
  • What area of the application should be covered and what should ignored.
  • Credentials or test data (or where to find them)
  • Rules. What to look for and what to ignore
  • Where to write the report with all findings: `๐ซ๐ž๐ฉ๐จ๐ซ๐ญ.๐ฆ๐`
๐Ÿ“Œ ๐‘๐ฎ๐ฅ๐ž๐ฌ ๐’๐ž๐œ๐ญ๐ข๐จ๐ง ๐๐ซ๐ž๐š๐ค๐๐จ๐ฐ๐ง in `๐ฌ๐ญ๐ž๐ฉ๐ฌ.๐ฆ๐`
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
What to look for (report these):
โคท Functional bugs. Button does nothing, wrong redirect, form does not submit
โคท Broken UI. Missing elements, layout breaks, overlapping content
โคท Wrong or missing copy on critical paths (checkout, login, errors)
โคท JavaScript errors that break user actions
โคท Failed network requests on critical APIs (auth, payment, save)
โคท Accessibility blockers.
โคท Dead ends. 404, infinite spinner, error with no recovery
What to ignore:
โคท Third-party analytics / tracking failures (Google Analytics, etc.)
โคท Benign console warnings (deprecated API in a vendor script)
โคท Cosmetic-only issues (misalignments, font weight on footer)
โคท Cookie banner / GDPR UI unless it blocks the flow under test
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
After you are done with the `๐ฌ๐ญ๐ž๐ฉ๐ฌ.๐ฆ๐`, just point the AI agent to the file and let it loose. The agent will read the file and create an empty `๐ซ๐ž๐ฉ๐จ๐ซ๐ญ.๐ฆ๐` to fill as it goes.
๐Ÿ” ๐‡๐จ๐ฐ ๐ˆ๐ญ ๐–๐จ๐ซ๐ค๐ฌ ๐”๐ง๐๐ž๐ซ ๐ญ๐ก๐ž ๐‡๐จ๐จ๐
For each step the agent performs:
โˆ™ `open` / `goto` the page using Playwright CLI
โˆ™ `snapshot` to read what is on screen
โˆ™ Decide the next action (click, fill, navigate)
โˆ™ Run the action
โˆ™ `snapshot` again
โˆ™ Append findings to `๐ซ๐ž๐ฉ๐จ๐ซ๐ญ.๐ฆ๐`
โˆ™ Move to the next step
๐“๐ก๐ž ๐š๐ ๐ž๐ง๐ญ ๐ฌ๐ญ๐จ๐ฉ๐ฌ ๐จ๐ง๐ฅ๐ฒ ๐จ๐ง ๐š ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ญ๐ž ๐›๐ฅ๐จ๐œ๐ค๐ž๐ซ:
โˆ™ Login wall with no credentials
โˆ™ Captcha or MFA with no bypass
โˆ™ Missing test data that cannot be inferred
โˆ™ Environment down (5xx, blank page, cannot load app)
๐€๐ญ ๐ญ๐ก๐ž ๐ž๐ง๐ ๐ฒ๐จ๐ฎ ๐ซ๐ž๐ฏ๐ข๐ž๐ฐ ๐ซ๐ž๐ฉ๐จ๐ซ๐ญ.๐ฆ๐ ๐š๐ง๐ ๐๐ž๐œ๐ข๐๐ž ๐ฐ๐ก๐š๐ญ ๐ญ๐จ ๐๐จ ๐ง๐ž๐ฑ๐ญ.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ“‹ Why `๐ซ๐ž๐ฉ๐จ๐ซ๐ญ.๐ฆ๐` is important
The agent writes to `๐ซ๐ž๐ฉ๐จ๐ซ๐ญ.๐ฆ๐` after every single step:
โˆ™๐˜๐จ๐ฎ ๐œ๐š๐ง ๐ฐ๐š๐ญ๐œ๐ก ๐ข๐ญ ๐ฅ๐ข๐ฏ๐ž. Open the file while the agent runs and see findings appear in real time. No need to wait for it to finish.
โˆ™ ๐๐จ๐ญ๐ก๐ข๐ง๐  ๐ ๐ž๐ญ๐ฌ ๐ฅ๐จ๐ฌ๐ญ. If the agent hits a blocker or crashes mid-session, everything found up to that point is already saved.
At the end you get a flat list of every action taken and every bug found.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐ŸŸ  ๐๐ซ๐š๐œ๐ญ๐ข๐œ๐š๐ฅ ๐“๐ข๐ฉ๐ฌ
โงฝ Run in parallel, not in series
If you have a few user workflows, run a few agents in parallel. Just open different AI chat windows and give each agent its own rules file.
โงฝ Headed vs headless
First run on a new flow: headed, so you can glance at the browser if needed. Repeat runs on the same flow: headless is fine.
โงฝ Exploration โ‰  automation
This is not a replacement for automation. Automation is deterministic; this approach is not. It is designed to mimic a human tester doing exploratory testing with somewhat random steps.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ“Œ Want to set this up on your repo with rules files, report templates, and live agent workflows?
Join the AI AutoTest Live Workshop โ€” hands-on practice with Playwright CLI, exploratory charters, and QA-specific agent instructions.
4
0 comments
Matviy Cherniavski
6
Autonomous Exploratory Testing with Playwright CLI and AI Agents
AI & QA Accelerator
skool.com/qa-automation-career-hub
From QA Automation to AI-Powered SDET. Join AI & QA Accelerator.
Leaderboard (30-day)
Powered by