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
Test AI Latency from First Token to Finished Answer
A fast first token can hide a late or invalid answer. Test queueing, streaming, and completion with a synthetic workload before accepting a model-serving change.
AI & AutomationTest the Trace Before You Trust the Dashboard
A correct AI answer can hide a broken trace. Use a synthetic request and a deliberately stripped context header to test whether your debugging evidence survives service boundaries.
Career & Best PracticesThe Cheapest Test Is the One You Run Before You Build
The most expensive engineering mistakes in my systems were not hard bugs. They were reasonable implementations of questions nobody had defined.
Quantitative TradingA Signal Is Not a Decision
A signal says that conditions are interesting. It does not say that the portfolio should trade. The missing layer is the decision record between detection and execution.
Latest Blog Posts
Test AI Latency from First Token to Finished Answer
A fast first token can hide a late or invalid answer. Test queueing, streaming, and completion with a synthetic workload before accepting a model-serving change.
Test the Trace Before You Trust the Dashboard
A correct AI answer can hide a broken trace. Use a synthetic request and a deliberately stripped context header to test whether your debugging evidence survives service boundaries.
The Evaluator Needs an Abstain State
A judge that must choose pass or fail will turn uncertainty into false confidence. Add an abstain state, calibrate it, and test the cases where the evaluator should refuse to decide.
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.