I Replaced My Entire Test Suite With an AI Agent — Here's What Broke
Suneet Malhotra
Mar 9, 2026
I Replaced My Entire Test Suite With an AI Agent — Here's What Broke
I've been saying for a while now that AI-driven test generation is the future of QA. But last month, I decided to stop theorizing and actually do it. I took a mature Playwright test suite — 2,000+ tests, built over 18 months — and handed the keys to an autonomous AI agent.
Here's the honest truth about what happened.
The Setup: From Scripted Tests to Autonomous Agents
The idea was simple. Instead of maintaining thousands of brittle selectors and step-by-step test scripts, I'd let an AI agent explore the application autonomously, using natural language objectives like "verify the checkout flow completes successfully" and "ensure user profile updates persist after page reload."
I built this on top of my Playwright + MCP + Ollama self-healing agent architecture. The agent uses a local LLM to interpret page state, decide what to click, and validate outcomes — all without hardcoded locators.
Week 1: The Honeymoon Phase
The first week was magical. The agent discovered and validated 73% of the critical user journeys without any test scripts. It found two real bugs that our existing suite had missed — both related to race conditions in async state updates that only manifested with slightly different interaction timing.
This is the superpower of AI agents in testing: they don't follow the same path every time. Unlike deterministic test scripts, the agent's slight variations in timing and interaction order expose bugs that scripted tests never catch.
Week 2: Reality Check
Then things got interesting. The agent started reporting false positives — flagging UI changes that were intentional redesigns, not bugs. Without the institutional knowledge baked into our test assertions, the agent couldn't distinguish between "this moved because it's broken" and "this moved because design updated the component."
Here's what specifically broke down:
- Visual regression detection — the agent flagged 40+ "failures" that were actually a planned design system update
- Business logic validation — the agent could verify UI interactions but struggled with domain-specific rules like pricing tier calculations
- Test data management — the agent created chaotic test data, making subsequent runs unpredictable
The Hybrid Model: What Actually Works
After three weeks of experimentation, I landed on what I'm calling the "AI-augmented, human-anchored" testing model. Here's the architecture:
AI agents handle:
- Exploratory testing and new feature smoke tests
- Accessibility audits (the agent was surprisingly good at catching a11y violations)
- Cross-browser interaction pattern discovery
- Self-healing locator maintenance for existing tests
Traditional scripted tests handle:
- Business logic validation with precise assertions
- Compliance and regulatory checkpoints
- Performance benchmarks with deterministic baselines
- Data integrity verification
The sweet spot? Let AI agents write the first draft of your tests, then have humans review and anchor the critical assertions. I've seen a 40% reduction in test maintenance time using this approach at Motorola Solutions.
What This Means for QA Engineers in 2026
If you're a QA engineer reading this and feeling nervous — don't be. The AI agent didn't replace me. It made me dramatically more effective. I spend less time fixing broken selectors and more time thinking about what should be tested.
The engineers who will thrive are the ones who learn to orchestrate AI agents rather than write test scripts line by line. Think of it as moving from "test writer" to "test architect."
My advice: start small. Pick your flakiest test suite, build a local Playwright agent, and let it loose. You'll learn more in a week than months of reading about AI testing.
Key Takeaways
- AI agents find bugs scripted tests miss — non-deterministic exploration is a feature, not a bug
- Pure AI testing isn't production-ready — you need human-anchored assertions for business logic
- The hybrid model wins — AI for exploration and maintenance, humans for critical validation
- Start with self-healing locators — it's the lowest-risk, highest-reward entry point
The future of Suneet Malhotra QA automation isn't about choosing between AI and traditional testing. It's about knowing when to use each. And honestly? That's a much more interesting job than maintaining 2,000 Playwright selectors.
Want to try building your own AI test agent? Check out my AI Test Case Generator and the Playwright Agent + MCP + Ollama project on GitHub.
Share this post
You Might Also Like
The Test That Cannot Name What It Expects
An LLM step is not a pure function, so no gate in this routine can assert what the post says. Every check I run is a property the output must obey, never a value it must equal.
AI & AutomationThe One Step I Never Hand to a Subagent
My content routine dispatches a fleet of subagents to gather, then hands none of them the draft. A fleet parallelizes retrieval. It cannot parallelize a voice.
Quantitative TradingA Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
Agentic AIThe Log Is Part of the Agent's Interface
An agent that can act but cannot leave a useful decision record is not autonomous. It is an opaque process with write access.
Latest Blog Posts
A Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
The Log Is Part of the Agent's Interface
An agent that can act but cannot leave a useful decision record is not autonomous. It is an opaque process with write access.
The Market Is Closed Is Not a Trading Rule
A backtest can know the exchange hours and still schedule a trade into a holiday, an early close, or a stale session. Calendar state is market data.
Related Tools & Demos
The QA Field Manual to Language Models
A free 24-chapter book. Start at “what is AI, really?” and finish with a small language model you built yourself — one that reads a failing Playwright test and proposes a fix you can run. Read it in your browser, or download the PDF or the Mac app.
View Source Code →Multi-Model LLM Harness
One interface to call any AI model — capability routing, fallback chains, budgets, circuit breakers, and a quality feedback loop. A practical architecture pattern write-up.
Automated Trading System
Multi-engine trading platform with real-time risk management, regime-based strategy selection, and automated order execution.
View Source Code →
Stay in the Loop
Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.
No spam, ever. Unsubscribe anytime.