Building 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
- Branch
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 - the agent builds your test in the cloud. You can run up to 10 cloud sessions in parallel.
- Generate against local app - choose local if your app only runs on your machine or private network, such as localhost or a preview build. The agent builds your test headlessly on your own machine using the mabl Desktop App. 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 appear on the Agents > Tasks page, where each task shows a real-time status and what the agent is working on. For task statuses, task details, how the agent works through each step, what to do when it needs your input, and how to get notified when a session finishes, see Agent tasks and notifications.