From Scripts to Goals: Agentic AI for QA Across Web, API and Database
Agentic AI for QA: test automation that gets a goal instead of steps, with web, API and database agents, MCP as the glue, memory, and its honest limits.
This article is published in English.
Sources: The Day My Test Scripts Stopped Listening — And My Agents Started Thinking : —
What changes when test automation stops being told which buttons to press and is told what outcome to reach instead? That question drives a small open-source experiment in agentic AI for quality engineering, and this write-up walks through what the experiment tries, where it helps and where it doesn't.
A familiar Tuesday
You launch the regression pack and green ticks scroll past. Everyone relaxes, and then a bug ships anyway, because the script only knew how to do exactly what it was told, in exactly the order it was told.
The nagging question is whether automation could reason instead of simply repeating. Nobody is promising magic here. The point is to see whether AI agents can complement a tester's judgment without pretending to replace it.
Scripted automation and goal-driven automation
Most suites today follow one chain: test case, script, execute, assert, report. It is deterministic, predictable and safe. It is also rigid, brittle and blind to anything the script never mentions. A scripted suite is a train on a fixed track: quick and reliable until the track moves.
The agentic version reverses the arrangement:
- Hand the agent a testing goal instead of a fixed script.
- Let it work out what needs to happen.
- Let it pick tools (browser, API client, database) according to context.
- Let it watch the results and adjust its next move.
- Let it validate and report.
So the request stops being "run these predefined steps" and becomes "here's the objective, find a way there". That is a change of mindset more than a change of tooling.
Why QA is a good fit
Modern software rarely lives in one layer. A single defect can sit across the UI, the API and the database and only show up when all three are checked together. Testers are increasingly expected to think like systems engineers, and the question has moved from "does the button work" to "does the whole distributed system behave under real conditions".
Suppose one agent could coordinate across those layers around a single objective instead of three disconnected suites. The design splits into:
- A web agent that drives the browser.
- An API agent that sends requests and analyses responses.
- A database agent that checks backend data.
- A reasoning layer that plans and decides which agent to call and when.
- A validation layer that merges everything into one actionable result.
Instead of three reports a human must stitch together mentally, you get one coordinated verdict.
The architecture sketch
The flow below is deliberately still evolving. It is a live experiment, not a finished framework, and real engineering progress seldom arrives fully formed.
User / Goal
↓
Agentic AI Layer (Reasoning + Planning)
↓
┌──────────┬──────────┬──────────┐
│ Web Agent│ API Agent│ DB Agent │
└──────────┴──────────┴──────────┘
↓ ↓ ↓
Browser APIs Database
↓ ↓ ↓
Validation / Result
MCP as connective tissue
The Model Context Protocol, MCP, is the part of this space worth a long detour. Think of it as a standard plug and socket between agents and real capabilities, so an agent doesn't just describe what it would do but actually does it.
For QA that opens up:
- connecting agents to genuine testing tools;
- structured browser interaction;
- direct API operations;
- database access without fresh custom glue each time;
- persistent memory and context;
- reusable libraries of automation tools.
The loop becomes: understand the goal, choose a capability, use the tool, observe the result, decide the next move. That differs sharply from "step one, step two, step three".
API testing as a capability
API testing isn't going away, but its shape changes. Rather than a static Postman collection running identical checks forever, an agent could:
- send requests derived from a stated objective;
- judge the response in context, beyond matching status codes;
- invent new scenarios on the fly;
- team up with other agents when a failure needs cross-layer digging.
Testing Objective → API Agent → Send Request → Analyze Response
→ Validate Result → Pass Result to Workflow
This is API testing that thinks about what it is checking, not just whether a number matched.
Database agents deserve more credit
Every SDET knows this story. The UI shows a success confirmation, the API returns 200 OK, and the database row never committed. Nothing flags it unless someone looks at the data directly.
An agent with database awareness can query and validate test data automatically, check the backend without a person writing raw SQL each time, support data-driven and cross-system tests, and catch the class of bug that lives between layers.
UI → API → Business Logic → Database
A defect may surface only when all four layers are validated together, which is where coordinated agents earn their place.
The browser as one tool among several
The sample project includes a web_surfer.py script that explores how an agent works in a real web environment, not as a lone script but as one capability in a set.
Testing Goal → Agent → Web Interaction → Observation
→ Decision → Validation
The browser stops being the whole test. It becomes a tool the agent reaches for when the objective calls for it.
Giving automation a memory
Most automation has goldfish memory, and every run begins from zero. The project keeps a small memory.json file to address that. It holds earlier actions, workflow state, test context, relevant observations and previous results.
Test Objective → Current Context → Previous Actions
→ Agent Decision → New Action → Updated Context
Context-aware automation doesn't meet the system as a stranger on each run. It builds a working memory, which is closer to how an experienced tester behaves.
What this is not
AI hype fatigue is real, so some clarity helps:
- It is not "AI replaces testers".
- It is not a plug-and-play testing bot.
- It is not a production-grade framework yet.
It is an honest, evolving experiment into how reasoning, tools and memory might reshape QA, and a reminder that engineering judgment still steers the ship. The aim isn't to automate everything. It's to automate intelligently.
Good QA still depends on risk analysis, test strategy, domain knowledge, exploratory testing, sound automation design, observability and human review of results. Agents should act as a sharper partner, not a substitute for the tester's thinking.
What the repo layout looks like
For anyone who wants to dig in, this is the structure of the sample project. The basics files are progressive foundations, a scenario file applies them, a selector file groups and picks capabilities, and the memory file stores context.
AgenticAIAutoGen/
│
├── Framework/
├── basics1.py → basics6.py → progressive foundational examples
├── scenario1.py → applied automation scenario
├── selectorGroup.py → capability grouping/selection logic
├── web_surfer.py → web interaction experimentation
├── memory.json → agent memory/context storage
└── .gitignore
The stack is Python with OpenAI Agents, MCP integration, API testing, database validation and browser automation.
Who benefits
The experiment is aimed at QA automation engineers and SDETs, quality leads, test automation architects, AI automation engineers, and engineering managers weighing AI-assisted QA.
Where it could go
The roadmap is ambitious because the field moves fast:
- multi-agent QA workflows;
- smarter test generation, including test data;
- AI-assisted API testing;
- autonomous browser testing;
- database validation agents;
- automatic failure and defect analysis;
- CI/CD integration;
- summaries of test results;
- full agent orchestration.
None of that replaces fundamentals. It sits on top of them.
The takeaway
The future of QA automation probably isn't writing more scripts faster. It's building systems that can:
- Understand a testing objective.
- Reason about the right approach.
- Act with the right tools across web, API and database.
- Evaluate the outcome.
- Adapt and feed back something useful to engineers.
That moves automation from something that merely executes to something that thinks alongside you, and it gives the tester a smarter engineering partner rather than a replacement.