A scenario every test engineer has lived through
A product manager moves a button by a few pixels — barely noticeable to the eye. The next day, 40 tests fail red in CI simultaneously.
After half an hour of digging, the culprit isn't broken business logic. It's a hardcoded CSS selector, #submit-btn-v2, that can no longer find the element — the DOM structure changed and the id changed with it. The business code is entirely correct; the test script died first.
This is one of the most common, most labor-draining, and least technically interesting failure modes in automated testing. It's also the starting point of this series: can LLMs turn this problem — and a few other long-standing ones in the testing world — from "brute-force human maintenance" into something that's actually engineered?
Three long-standing problems in traditional automated testing
Before discussing what LLMs can do, let's name the problems clearly. None of these are new — the industry has debated them for over a decade without a cheap, general solution.
Problem 1: Fragile Locators
Automated test scripts have to "find" an element on the page before they can act on it — click a button, fill a form, read some text. The common ways to locate an element are CSS selectors, XPath, element IDs, or raw coordinates.
All of them share the same fatal assumption: the UI structure won't change after the test script is written. In reality, UI structure changes constantly — redesigns, A/B tests, a front-end framework rewrite that restructures the component tree. The more specific a script's dependency on UI structure, the more fragile it becomes.
Selector specificity Robustness Maintenance cost
────────────────────────────────────────────────────────
#submit-btn-v2 Very low Breaks on any UI tweak
.btn.primary Low Breaks on class refactor
//div[3]/button[1] Very low Breaks on DOM hierarchy change
Coordinates (320, 480) Very low Breaks on resolution/layout changeThe industry has a name for this: "selector hell." The larger a test team grows, the higher the proportion of engineering time spent maintaining locators — not writing new tests, but fixing the locating logic of old ones.
Problem 2: The Oracle Problem (how do you know if the result is right?)
"Oracle" in testing refers to the standard used to judge whether an output is correct. A traditional unit test's oracle is explicit: assert result == 42. But in many testing scenarios, the oracle itself is fuzzy:
A screenshot differs from the last version by a few pixels — is that a bug,
or just font-rendering jitter?
The returned JSON has an extra field — is that an API change,
or dirty test-environment data?
The user flow completed, but the page "just doesn't look right" —
hard to say exactly what's wrongThe traditional fix is to make the oracle explicit: pixel-level diffing (what threshold counts as a real change), schema validation (which fields must exist), assertion chains (explicitly checking state at each step). The shared problem with these approaches: the stricter the oracle, the more false positives (flagging meaningless changes as failures); the looser the oracle, the more false negatives (real bugs slip through).
Problem 3: Maintenance Cost (test scripts age faster than the business code)
This is a consequence of the first two problems, but it deserves its own callout because it's the direct reason teams eventually abandon automated testing.
A real pattern: teams that iterate faster on features tend to end up with lower actual test coverage over time — not because nobody wants to write tests, but because tests go stale the moment they're written, nobody has time to fix them, and eventually they get skipped or ignored outright. The entropy of the test codebase grows faster than the team's capacity to maintain it.
These three problems reinforce each other: fragile locators → tests fail red constantly → maintenance cost rises → the team has no time to maintain them → coverage gets cut → the oracle problem becomes harder to catch (because coverage itself is shrinking).
Why now: testing happens to be a "clear right-or-wrong" scenario
For the past two years, LLM Agent adoption has stalled in the same place across many domains: how do you know the Agent got it right? Writing code, making decisions, generating content — the "correctness" of these outputs is usually continuous and subjective, requiring a whole separate evaluation layer to judge (which is exactly what the eval-series on this blog is about).
Testing is the exception. A testing task carries its own explicit success signal:
Unit test passes / fails —— boolean, no middle ground
UI element found / not found —— boolean
Assertion holds / doesn't hold —— boolean
Coverage increased by X percentage points —— a quantifiable numberThis means the quality of an LLM's output in a testing context can be verified using the test's own execution result, without needing an extra meta-layer of "is this LLM output reasonable." This is a structural advantage testing has over other LLM use cases — and it's why the past two years have produced a wave of open-source projects that actually work in production, not just proof-of-concept demos.
That said, "clear right-or-wrong" only applies to the test's final execution result. Whether a test script should be generated, whether a locator should self-heal, whether a failure is a real bug or an environment flake — these judgments remain fuzzy. That's exactly where LLMs have room to intervene, not in the final "did the test pass" verdict itself.
Three places where LLMs can plug in
Coming back to the three problems from the opening: here's where LLMs can plug in for each.
Fragile locators → Semantic locating ("find the submit button" instead of "find #submit-btn-v2")
→ Self-healing locators (when the UI changes, re-find the element
semantically instead of the script just dying)
Oracle problem → Semantic judgment ("is this visual change an actual bug to the user")
→ instead of pure pixel/structural comparison
Maintenance cost → Coverage-driven automatic test generation
→ Automatic failure classification (real bug / environment issue / test issue)These three threads map to what the rest of the series will cover: unit test generation (03), Web/mobile UI automation (04-09), self-healing locators (10), API testing (11), visual regression (12), and failure classification (13).
The next post (02) will first lay out the shared technical foundation behind all of these approaches — visual grounding, DOM-based semantic understanding, and pure coordinate-clicking Computer Use. Each has its own principles and trade-offs, and this vocabulary will be reused in every case study that follows.
What this series won't do
Setting expectations upfront:
- This is not a trend-report on "AI testing." Each post picks one technical point paired with a verifiable open-source project — no "reportedly," no "may become possible in the future" claims that can't be checked
- This isn't about evaluating LLM output quality. That's the
eval-series's territory. This series is about "using LLMs to do testing," not "evaluating LLM outputs" - Limitations won't be glossed over. Every technical approach comes with a discussion of where it breaks down and what it costs
Summary
- Fragile locators, the oracle problem, and maintenance cost are the three long-standing problems in automated testing, and they reinforce each other
- Testing tasks carry an explicit success signal (pass/fail) — this is testing's structural advantage over other LLM use cases
- LLMs plug in at semantic locating/self-healing, semantic oracle judgment, and automatic generation/classification — not at replacing the final "did the test pass" verdict itself
Check out PrimeSkills — a curated marketplace of AI agents and skills that have been validated in real-world, enterprise-grade workflows. No fluff, just what actually works.
Find more useful knowledge and interesting products on my Homepage