4 / 108 · 03 Agentic Testing Architectures · The ReAct Core Loop for Testing← prev⊞ allnext →☰ Read as one page
1.4Why ReAct Matters for Testing
The key insight: the agent does not follow a fixed script. It adapts its next action based on what it observes. This creates capabilities that deterministic scripts cannot match:
| Capability | Script-Based Testing | ReAct Agent Testing |
|---|---|---|
| Missing element | Test fails immediately | Agent looks for alternative selector |
| Unexpected popup | Test fails or blocks | Agent dismisses popup and continues |
| Slow page load | Timeout (fixed wait) | Agent observes loading state, waits intelligently |
| Changed layout | Test fails (selector broken) | Agent reasons about new layout |
| Error state | Test follows happy path only | Agent investigates the error |
| New feature | Test ignores it | Agent notices and can explore |
Example: Adaptive Error Investigation
Step 1: OBSERVE — Login page loaded, email and password fields visible
Step 2: THINK — "I should fill in valid credentials and click login"
Step 3: ACT — Type email, type password, click submit
Step 4: OBSERVE — Error banner appeared: "Account locked after 5 failed attempts"
Step 5: THINK — "Unexpected error. This is not a test failure, it is test
environment state. The account was locked by a previous test run.
I should report this as an environment issue."
Step 6: ACT — DONE fail "Account locked - environment state issue, not a bug"
A deterministic script would simply fail with "Expected dashboard URL, got login URL." The agent provides diagnostic information.