Agentic testing: How AI agents execute and maintain tests autonomously
Published on

Most tools that say they use AI still need a person to write the test, fix it when it breaks, and rerun it to confirm the fix worked. Agentic testing hands that whole loop to software: it explores the application, plans the test, writes the code, runs it, and repairs it when the application changes. This post follows one test through that loop and shows where the AI works, where stored code takes over, and where a person still signs off.
What agentic testing means (and what it doesn’t)
An agent works toward a goal, such as “cover the checkout flow”. It decides its own next step, acts on the application, and checks the result before moving on. That is a different shape of work than most tools marketed as AI testing.
It is not the same as a generative tool that returns a script from a single prompt and then stops, waiting for a person to run it, check it, and fix it by hand. It is also not record-and-playback, which replays the exact clicks it was recorded on and breaks the moment the page underneath it changes.
Within agentic testing itself, two designs exist. One has a model deciding every click live, at the moment the test runs. The other has agents write test code once, verify it, and run that stored code on every execution afterward, which is the approach Klarent takes. The distinction matters more than it sounds: deciding every click live means every run re-reasons from scratch, while running stored code means the reasoning happened once, during generation, and every run after that is fast and repeatable.
Klarent generates and verifies code once, then runs that stored code on every execution rather than reasoning live on every run.
Autonomous does not mean unsupervised, either. People review tests before they join the suite, which is covered in more detail further down.
How the agents divide the work
Rather than one general-purpose model doing everything, the work is split across a multi-agent system with specialized roles:
- Explorer maps the application’s screens, flows, and states, and can suggest test scenarios from a website URL, an existing test, or an uploaded product document.
- Planner designs the test plan for what the test needs to accomplish.
- Coder writes the executable code for each step, Playwright for web tests and Appium for mobile tests.
- Verifier checks the plan before any code is written, and checks the generated code afterward, sending work back to the Planner when something fails that check.
- Runner and Notifier run the verified suite and send results to Slack, Microsoft Teams, or email.
Each agent has one job, which is what lets the system verify its own work at every step instead of trusting a single pass.
Splitting the work this way means a mistake at one stage gets caught by the next agent in line rather than silently becoming generated test code that looks plausible but does the wrong thing.
The Explorer can start from written instructions, existing tests, a website URL or product documentation.
Inside one test: The step-by-step generation loop
Take a typical instruction: log in with a username and password, add a product to the cart, apply a promo code, and stop at payment. Generation works through that instruction one step at a time rather than producing the whole script in one shot.
For each step, the loop reads the current state of the page, decides the next step, writes the code for it, runs that code, then takes a screenshot and checks it matches the expected result. If the code fails, the agent rewrites it and tries again. A step is only kept once it works. Failed attempts are shown greyed out, visible for debugging, but left out of the final script entirely.
Each step is written, run and checked by the Verifier before the next one starts.
Generation ends once the instructions are fulfilled. If the agent cannot complete them, it stops rather than guessing. Mobile tests follow the identical loop on a real device, producing Appium code and device screenshots at each step instead of browser-based Playwright code.
Why each run uses stored code, not a live model
The last successfully generated code is what executes on every run, not a model reasoning through the application fresh each time. Each run starts in its own isolated environment, and runs can be scheduled, triggered from CI/CD, or run in parallel with no concurrency cap.
That distinction is what keeps cost and behavior predictable: the model does its work when a test is written or repaired, not on every click of every run. It also means a run is inspectable afterward in a way a live-reasoning approach is not. You can review the executed steps with their screenshots and code, the error message if something failed, and, for website tests, Playwright traces with console and network logs.
A failed run shows the step that broke, with its screenshots, code, traces and error message.
This is also where test code portability matters. Klarent generates Playwright code for website tests, which means the test suite is not locked inside the platform that created it.
How agents keep tests working when the app changes
A failed run shows which step broke, and from there the test can be healed against the latest version of the application. Klarent proposes the fix and shows what changed before anything is applied, so a person reviews and accepts the change rather than it happening silently in the background.
Healing handles the ordinary churn well: renamed or moved elements, changed IDs and locators, small changes to a flow. What it should never hide is a real bug. If a checkout total is suddenly wrong, the test should fail, not heal around it, and reviewing the proposed change is how a team tells the difference between “the UI moved” and “something broke.” This works for both website and mobile tests, and it is the core of what keeps test maintenance from becoming a full-time job as an application evolves.
Where people stay in the loop
Every generated test is reviewed before it joins the suite, so engineering keeps control of what runs. If something goes wrong mid-generation, a person can cancel and edit the first incorrect step, and everything after it regenerates from there rather than requiring a full restart.
A few more direct controls exist for correcting a step that has drifted: force click lets someone point at the right element on a website test to turn it into a stable locator, and a coder hint lets a person guide the code agent directly when the instruction was right but the generated code picked a fragile approach. A failed verification can be overridden when a person is confident the step outcome is correct, individual steps can be marked optional, and a test can be marked complete early if the remaining steps are not needed.
From one dialog, a person can rewrite a step, force click the right element or give the code agent a hint.
Guardrails sit around all of this: custom code modules need admin approval, and role-based access controls who can author, approve, and run tests.
Questions to ask any agentic testing vendor
A short list of direct questions tends to reveal more than a feature list:
- Where is the model in the run path: writing tests, running them, or both?
- Can you see and export the code behind every step?
- When a step fails, does the tool retry, heal with review, or quietly pass?
- Who approves changes, and is there an audit trail?
- Where does it run (cloud, private cloud, or on-premises), and how does it reach test environments that are not publicly reachable?
- How are secrets handled in logs and screenshots?
What this looks like in real deployments
A Tier-1 global bank had agents autonomously cover 80 of its highest-risk banking journeys across web and mobile in the first engagement, cutting manual QA effort on those journeys by roughly 90%.
A leading Canadian financial services company automated more than 150 production tests in a single day and now runs over 100 automated executions every hour, with the first real bugs caught within 7 days of going live.
At NZZ, tests run on an hourly schedule and every 15 to 30 minutes on revenue-path flows, and more than half of the end-to-end tests are now written directly by Product and Business teams rather than QA engineers alone.
The person’s job changes, not disappears
Agentic testing is not about removing people from QA. It moves human effort to the parts that need judgment: reviewing a generated test, confirming a healed step is safe, and deciding what a failure means. Software carries the repetitive work of writing, running, and maintaining test automation in between.






