UI Automation Enters Its Third Generation: A Perceive-Decide-Act Loop

A recent sharing on Jejin (稀土掘金) reveals the third generation of UI automation: test design is being restructured—humans define goals, systems perceive states, agents plan paths, and engineering mechanisms handle validation and asset management. Unlike traditional scripts, multimodal agents build a continuous “STATE-ACTIONS-DECIDE-REWARD” loop where every decision is dynamically generated based on the real-time page state. Moving from prototype to production requires crossing four critical hurdles: perception distortion, non-replayable instructions, exploration loss of control, and execution interruption—each demands engineering guardrails to converge uncertainty.
Core Challenge: Testing Design Lags Behind System Changes

Marketing middle-platforms face high-frequency changes under peak-season rushes. Page structures, button texts, and validation rules change rapidly, yet configuration-critical paths must maintain robust quality. Legacy automation suffers three core problems: scripts embody “one-time solidification of system understanding”—once the UI shifts, the conclusions break; edge-case coverage remains largely void, with validation gaps still relying heavily on manual testing; and there is a clear capacity ceiling—manual engineers produce only ~10 effective automation cases per module per day, concentrated on positive main flows.
A key counterintuitive insight: teams thought the bottleneck was “how to write” (e.g., locator maintenance), but the real issue is “what to test”. The first two generations (record-playback, PO-driven) improved script expressiveness but failed to automate the coverage of edge cases. Empty fields, excessive lengths, time inversions, etc., still need manual enumeration—which is precisely what multimodal agents aim to solve.
Three-Generation Comparison & Architecture Design

| Technology Generation | Core Approach | Solved | Unresolved |
|---|---|---|---|
| 1st (Record/Playback) | Direct DOM path capture | Rapid recording | Extremely brittle; minor UI changes break entire paths |
| 2nd (PO-Driven) | Page-object abstraction, keyword encapsulation | Improved locator maintainability | Still requires humans to define “what to test” |
| 3rd (Agent Exploration) | Human defines goal, agent dynamically plans edge-case paths | Continuous perception, dynamic edge/boundary exploration | Requires engineering layer to guarantee determinism |
Take “validate activity name field validation rules” as an example: Generation 3’s objective isn’t executing a pre-written script but generating “replayable, reviewable, manageable high-quality test cases”. General-purpose agents can explore single edge cases, but the real differentiator is engineering convergence capability—turning exploration into scalable, asset-sustainable system capability rather than a one-off task.
The architecture comprises four layers: access layer (task initiation), scheduling layer (concurrency), intelligent planning layer (validation/correction before DSL execution), and execution layer (browser orchestration). The key tradeoff in path planning: “more model calls, no derailment”—open-loop plans fail catastrophically once an unexpected popup derails step 3, whereas closed-loop planning re-plans every step, adapting to deviations.
Four Production Hurdles & Engineering Guardrails

A working demo ≠ production-ready. LLMs provide “possibilities”; engineering must supply “certainty”. Four key mechanisms:
- Dual-signal perception layer: DOM generates candidate elements (with 4-level filtering), screenshots judge state (e.g., greymask, occlusion), historical trajectories prevent repetition. Chinese space normalization and viewport-out-of-sight marking (requiresScroll) are engineering essentials.
- Instruction validation/correction layer: After model generation, check element type, viewport position; non-executable instructions get rewritten or blocked. Guideline: “whenever deterministically verifiable, reclaim from probabilistic models"—the validation layer buffers freedom and reliability.
- Two-tier convergence to prevent dead loops: Operation layer checks similarity of consecutive actions (prevent repeat submission); path layer compares overall similarity of past trajectories—more shared prefix = higher tendency toward novel actions. Unconstrained exploration falls into “open popup - click cancel - reopen” dead loop.
- Failure-divergent self-healing: Distinguish recoverable failures (e.g., unreachable element → retry scroll; locator drift → re-plan) and non-recoverable ones (infrastructure jitter → retry; environmental failure → terminate with reason).
Implementation Guidance & Future Directions
Who should adopt now: high-change marketing configuration teams with strong quality demands but limited QA resources. Low-change, stable scenarios still favor PO-driven approaches; insufficient budget for full-agent infrastructure warrants phased PoC validation first.
Who should wait: teams without CI/CD integration or standardized case-asset pipelines. Real-world deployment demands existing test framework alignment and platform asset ingestion capability—mismatch causes technical drift.
Future directions are clear: integrate with “new-feature testing” (deliver boundary-defect checklist alongside feature sign-off); and defect-pattern documentation solidification with active re-inspection—abstract single bugs into transferable patterns (e.g., “date inversion”) for periodic re-screening across similar fields, shifting discovery from “luck-based” to “memory-driven”.
Write at the end: The true leap in UI automation shifts from “can the script run” to “can the system continuously comprehend, explore, and generate high-quality test cases”. It’s not merely tooling iteration—it’s a foundational reengineering of test methodology. When agents, freed from human cognitive bias, execute “nobody would ever do this” operations, they often uncover real quality blind spots faster than human test designers.
