When a test needs a change, such as a new assertion, an updated selector, or a fix after the app changed, you can hand the work to the mabl agent instead of re-training steps in the mabl Trainer. Describe the change in plain language, and the agent opens the test, applies your edits, runs it to confirm it still passes, and reworks anything that fails before saving. This article explains how to edit a browser test with the agent.
Editing runs in the background, so you can hand off an edit and keep working, or start several edits in parallel.
1. Start an editing session
From the test details page, open the edit menu and choose Edit with mabl.
You can also start an edit from wherever you're already working:
- A failed run - when runtime recovery detects that a failing test needs updating, click Improve test in the run's results summary. mabl hands the agent the failure details and pre-fills a prompt, so you can turn a failure straight into a fix.
- The mabl agent chat - go to Build tests > Start chatting... and point the agent at the test you want to change.
-
mabl MCP - use the
mabl_authoring_edittool from any MCP client, such as Claude, Cursor, or VS Code, to edit a test by ID. See the mabl cloud MCP tools reference. -
mabl CLI - run
mabl agent authoring initiatewith atest_idin--test-information. See author mabl tests from your AI coding agent.
2. Describe the change you want
Describe the edit relative to the test as it exists today, rather than restating the whole workflow. How you phrase it depends on the kind of change:
- For a targeted change, name the step or point in the test you want to affect: "After the checkout step, add an assertion that the confirmation page shows the customer's name."
- To fix a stale test, describe the app's new expected behavior and let the agent reconcile the steps: "The login form moved into a modal that opens from the Sign in button. Update the login steps to match."
The clearer your prompt, the closer the result. The guidance that makes a strong creation prompt applies to edits too: see how to write an effective browser test prompt for more details. For the interactions the agent can and can't perform, see agentic test authoring capabilities.
3. Let the agent apply and verify the edit
The agent opens the test, makes your changes, and replays the test to confirm it still passes, reworking anything that fails before it saves. Because the session runs in the background, you don't have to wait. In the meantime, you can start another edit or work on something else.
Editing sessions appear on the Agents > Tasks page alongside test creation sessions, each with a real-time status and a Latest activity column. For how to read task statuses and open a session's details, see monitor your sessions.
4. Review the edit on a branch
By default, edits made by the mabl agent are saved to a branch instead of your default branch, so you can review the changes before merging them in. Open the branch, confirm the edit does what you asked, and merge it into your default branch.
Workspace owners control this default from Agents > Settings, under Agent behavior, with the Require agent edits on branches setting:
- Leave it on to require review of every agent edit before it reaches the default branch.
- Turn it off to let the agent save edits directly to the default branch.