Creating and maintaining reliable browser tests can take up a lot of time. With the mabl agent, you can streamline this process by describing what you want the test to accomplish in natural language. The agent then takes on the work of generating test steps, basing its decisions on contextual information from your workspace, so that you can free up time to focus on more strategic work.
You can have the agent build your test in the cloud or headlessly on your own machine and run several sessions in parallel while you keep working. This article explains how to create a browser test with the agent and track its progress:
To bring in the agent while you're creating or editing a test in the Trainer, see using agent mode in the Trainer.
Name change
Agentic test authoring was formerly described as the Test Creation Agent and GenAI Test Creation.
Create a new browser test with the agent
To create a new browser test with the mabl agent, go to Build tests > Start chatting... in the app and provide your test prompt details. If you aren’t sure what information to provide, see our article on writing an effective test prompt.
Optionally, you may also specify up to three tests for the agent to reference for screenshots of the relevant user flow.
When you submit a prompt, the agent searches your mabl workspace for additional context, including an application summary and related tests, flows, and snippets. Using this context, the agent builds a test outline. If the outline doesn’t look correct, send followup messages to refine it until it aligns with your goals.
Agent instructions
If you notice that the agent makes the same mistakes when interacting with your app, add agent instructions in Agents > Settings. Scope your instructions to that they apply to test authoring for the relevant application and environment.
Test references
When planning the new test, the agent pulls screenshots from your relevant test runs to serve as context. You can either:
- Provide test references when you submit your initial prompt, OR
- Let the agent automatically search your workspace and identify up to 3 relevant test references for you.
To review and manage test references, expand the test references icon. If needed, you can manually remove or add test references to ensure the outline aligns with your objectives.
Test information
The agent generates high-level details for your test and displays them in the Test information section, including:
- Test name
- Test case
- Test description
- Application
- Environment
- URL
- Credentials
If any of the information is incorrect, click on the pencil to edit it directly.
Test outline
In the Test outline section, the agent generates a detailed approach to implementing the test, including:
- Implementation notes - the general idea of the test
- Tasks - each task includes a suggested validation for the end of the task
- Suggested flows and snippets - each flow/snippet includes reasoning for why it was suggested and a confidence level: “preferred” indicates the agent is more likely to use the flow/snippet, “secondary” indicates the agent is saving the flow/snippet as an alternative option.
- Screenshots - if there are test references, the agent uses screenshots from their test runs as context when generating the outline.
To refine the test outline, send followup messages with your specific corrections. For example, “In the test outline, remove the flow ‘Admin Login Flow’ from the first task.” If the screenshots don’t look correct, double check the test references and manually update them as needed.
Limitation
When importing relevant flows, the agent currently does not consider flows that aren’t used in any tests.
Choose how to build your test
When you are happy with the outline, select a build approach:
- Generate in cloud - the agent builds your test in the cloud. You can run up to 10 cloud sessions in parallel.
- Generate locally - the agent builds your test headlessly on your own machine using the mabl Desktop App. Choose local if your app only runs on your machine or private network, such as localhost or a preview build. Because sessions run in the background, you can start as many local authoring sessions as your machine can handle.
With either approach, the agent runs the test as it builds to confirm the steps pass, reworking anything that fails before saving. Both cloud and local sessions appear on the Agents > Tasks page, where you can monitor their progress.
You can also run headless test authoring from your coding agent with the mabl CLI.
Monitor your sessions
Both cloud and local sessions run in the background, so you can start more sessions or work on something else while the agent builds. The Agents > Tasks page tracks the progress of each session as a task, with a real-time status and a Latest activity column so you can see what the agent is working on without opening every task.
What can the agent do?
For a complete list of supported and unsupported interactions, click here.
Active and completed tasks
Sessions are organized into two sections:
- Active - tasks that are currently in progress or need your attention. Active tasks appear at the top of the page.
- Recently completed - tasks that have finished building or were stopped. Completed tasks appear below active tasks.
You can run up to 10 cloud authoring sessions at the same time. If you reach this limit, mabl prompts you to generate the test locally instead. Local sessions are limited only by what your machine can handle.
Task statuses
Each active task displays one of the following statuses:
- Queued - the task is waiting in line for the agent to start working on it.
- Building - the agent is actively building the test. No action is required.
- Review - the agent finished successfully. The generated test is ready.
- Needs input - the agent stopped because it couldn't determine the next action. Check task details to get more information.
- Stopped - the task was stopped before finishing because either a user stopped it or the task duration exceeded 3 hours.
Task details
To view more information about a session, click on the task to open its detail view. Task details include:
- The test name and a link to open the test
- An Agent actions section that tracks what the agent did during the session
- The current status and description
- A timestamp for when the build started and ended
- A button to Revisit planning session to review your original conversation with the planning agent
RBAC permissions apply to viewing task details. For example, if a session used protected credentials that you don’t have permissions for, you can’t access that session’s task details.
Needs input
If the agent stopped on a needs input status, the task description explains what the agent needs. To continue building the test:
- Open the test in the Trainer.
- Play the test up to the point where the agent couldn’t determine the next action.
- To get the test unblocked, either finish the remaining steps manually, or switch to agent mode in the Trainer and let the agent continue.
Understanding agent activity
As it builds each step, the agent bundles steps together into step groups based on the test outline, and replays steps it has already created to verify they still work. If a step fails during replay, the agent undoes it and retries with a different approach, iterating multiple times if needed before moving on.
For each step, the agent follows a cycle:
- Plan - plans the next action based on the prompt and screenshots
- Act - visually locates and interacts with elements on the screen
- Reflect - reflects on what changed to determine whether the action succeeded.