AI & Automation4 min read

I Replaced My Entire Test Suite With an AI Agent — Here's What Broke

S

Suneet Malhotra

Mar 9, 2026

1 views
I Replaced My Entire Test Suite With an AI Agent — Here's What Broke - AI & Automation blog post
🔧AI Agents🔧Playwright🔧LLMs🔧Self-Healing Tests🔧QA Automation🦙Ollama

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

  1. AI agents find bugs scripted tests miss — non-deterministic exploration is a feature, not a bug
  2. Pure AI testing isn't production-ready — you need human-anchored assertions for business logic
  3. The hybrid model wins — AI for exploration and maintenance, humans for critical validation
  4. 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

Stay in the Loop

Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.

No spam, ever. Unsubscribe anytime.