AI in Software Testing interview question
What are AI test agents and MCP browser tools such as Playwright MCP, and where do they fit?
Short answer
An AI test agent is an LLM in a loop that calls tools, such as a browser exposed through the Model Context Protocol (Playwright MCP). It helps explore apps, reproduce bugs and draft tests, but is still experimental as an unsupervised gate: nondeterministic, costly and needing review.
Answer
This area is moving quickly, so I separate what is established from what is experimental.
Definitions
AI agent. An LLM running in a loop: it receives a goal, decides on an action, calls a tool (click, type, run a command, call an API), observes the result and decides the next step until it believes the goal is met.
Model Context Protocol (MCP). An open protocol for exposing tools and data to LLM applications in a standard way. An MCP server publishes tools; an MCP-capable client (an IDE assistant, a desktop chat app, an agent framework) lets the model call them.
Playwright MCP. An MCP server maintained by the Playwright team that exposes browser automation as tools: navigate, click, type, take a snapshot and so on. By default it gives the model a structured accessibility snapshot of the page rather than relying on screenshots, which makes element targeting more reliable than pixel-based approaches. Playwright has also added agent-oriented features for planning and generating tests; I’d check the current docs before relying on specifics because they are evolving.
Where agents add value today
- Exploratory assistance. “Try to complete checkout with an expired card and report anything odd.” The agent explores paths, and a human evaluates findings.
- Bug reproduction. Turning a vague bug report into concrete steps against a test environment.
- Drafting tests. The agent walks a flow in a real browser, then produces a Playwright test using real locators it observed. The output is ordinary code, reviewed and committed like any other test. This pattern is the most practical one: use the agent at authoring time, run deterministic code at CI time.
- Failure triage help. Summarising traces, logs and diffs to suggest a likely cause.
Why they are not (yet) the regression gate
- Nondeterminism. The same prompt can take different paths on different runs. A release gate needs repeatable results.
- The oracle problem. The agent decides whether the outcome “looks right”. Without explicit expected results it may report success on a broken flow.
- Cost and speed. Each step is a model call, so agentic runs are much slower and more expensive than a scripted test.
- Security. Agents with browser and tool access can be manipulated by prompt injection in page content, and must not hold production credentials or broad permissions. Run them against test environments with least-privilege accounts.
- Auditability. You need logs of every action to trust or debug a run.
Fully autonomous agents that maintain and gate an entire suite are emerging and experimental. I wouldn’t let one approve a release without deterministic checks and human review.
How I’d introduce them in a team
- Start with authoring and exploration in a sandbox environment.
- Require generated tests to go through code review and to follow our framework conventions.
- Measure usefulness honestly: bugs found, time saved on drafting, false reports.
- Keep the CI suite deterministic.
What interviewers look for
- Accurate definitions of agent, MCP and Playwright MCP without inflating capabilities.
- The “agent at authoring time, code at run time” pattern.
- Clear limitations: nondeterminism, oracle, cost and prompt-injection risk.
A strong answer covers
- Agent = LLM loop that plans, calls tools and observes results
- MCP is a protocol exposing tools; Playwright MCP exposes browser actions via accessibility snapshots
- Good uses: exploration, reproduction, drafting deterministic tests
- Limitations: nondeterminism, cost, oracle, security; not a release gate yet
- Keep humans and deterministic tests in the loop