mabl AI-Powered Testing: Getting Started & Best Practices
mabl positions itself as the testing tool that doesn't break every time your developers ship. The pitch is compelling: AI-powered element detection that adapts when your UI changes, so you spend less time fixing tests and more time writing them. After years of Selenium-based suites where a CSS refactor would detonate hundreds of tests overnight, that's a genuinely attractive proposition.
This guide covers how mabl actually works — not the marketing version, but the mechanics behind the features — and gives you a realistic picture of where it excels and where its current limitations will frustrate you.
How mabl's AI Actually Works
mabl's differentiating feature is what they call auto-healing — the ability to find UI elements even when the properties you recorded have changed. Under the hood, mabl builds a multi-attribute fingerprint for each element during test creation: tag name, text content, ARIA attributes, position in the DOM hierarchy, CSS classes, and several other signals. When it runs a test and the primary locator fails, it evaluates the remaining attributes and picks the best available match.
This is meaningfully different from simple XPath or CSS fallback chains (which you can implement in any framework). mabl's approach assigns confidence scores to matches and logs when it had to "heal" — you can review all auto-healing events in the dashboard and decide whether to accept them permanently or investigate the underlying change.
Visual testing in mabl compares screenshots pixel-by-pixel against a baseline, but with layout analysis that distinguishes intentional redesigns from regressions. It flags differences by severity, and you can set acceptance regions to ignore dynamic content like timestamps or ads.
ML-based element detection means mabl analyzes your application during training runs and builds a model of which elements are stable identifiers versus which are likely to change. It weights stable attributes more heavily in its fingerprint. You don't configure this directly — it happens in the background as you run tests over time.
Creating Your First mabl Test
mabl uses a desktop Trainer app where you record interactions, and a cloud Runner that executes them. You don't write code to create a basic test.
- Sign up at mabl.com and create a workspace
- Download the mabl Trainer for your OS (Mac, Windows, Linux)
- In the Trainer, click "Create new test"
- Enter your application URL and click "Start"
- Interact with your application — mabl records every click, type, and navigation
- Add assertions by clicking "Assert" on any visible element
- Click "Complete" to save the test
The Trainer generates a test that runs in mabl's cloud infrastructure. There's no test code to check in, no test runner to configure, and no browser drivers to manage.
A recorded login test looks something like this in mabl's internal representation (you'd never write this directly, but it's useful to understand what's happening):
Navigate to: https://app.example.com/login
Type "user@example.com" into: [email] input
Type "••••••••" into: [password] input
Click: [Sign In] button
Assert: URL contains "/dashboard"
Assert: text "Welcome back" is visiblemabl stores tests in its cloud — there are no local test files. This is a meaningful architectural decision with tradeoffs we'll cover in the limitations section.
Trainer vs Runner
The Trainer is a local desktop app that wraps a browser (Chrome under the hood). It captures your interactions and adds mabl's recording hooks. You use the Trainer to create tests, update steps, add assertions, and debug failures.
The Runner is mabl's cloud execution environment. It runs your tests on demand or on a schedule. Runners are managed by mabl — you don't provision or maintain them. Tests run in isolated environments, each with a fresh browser state.
You can also install a local agent if you need to run tests against localhost or internal services that aren't publicly accessible:
# Install the mabl agent
npm install -g @mablhq/mabl-cli
# Start the agent (keep running during test execution)
mabl agent startThe agent creates a tunnel from mabl's cloud runners back to your local machine, similar to ngrok.
Integrating with CI/CD
GitHub Actions
The official mabl GitHub Action makes integration straightforward:
# .github/workflows/mabl-tests.yml
name: mabl Tests
on:
pull_request:
branches: [main]
jobs:
mabl-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run mabl tests
uses: mablhq/github-run-tests-action@v1
with:
application-id: ${{ secrets.MABL_APP_ID }}
environment-id: ${{ secrets.MABL_ENV_ID }}
api-key: ${{ secrets.MABL_API_KEY }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: mabl-results
path: mabl-output/The action triggers a mabl plan (a collection of tests), waits for results, and fails the CI build if tests fail. You configure which tests run by creating a plan in the mabl dashboard and referencing its ID in the action.
Jenkins
pipeline {
agent any
stages {
stage('mabl Tests') {
steps {
sh """
mabl run \
--app-id ${MABL_APP_ID} \
--env-id ${MABL_ENV_ID} \
--api-key ${MABL_API_KEY} \
--await-completion \
--output-dir mabl-output
"""
}
post {
always {
archiveArtifacts 'mabl-output/**'
}
}
}
}
}mabl CLI
The CLI gives you control over test execution outside of the Trainer UI:
# Install
npm install -g @mablhq/mabl-cli
# Authenticate
mabl login
# List your applications
mabl apps list
# List environments
mabl environments list --app-id <app-id>
# Run a specific plan
mabl run plan --plan-id <plan-id> --await-completion
# Run all tests for an application/environment
mabl run --app-id <app-id> --env-id <env-id>
# Run with specific browser
mabl run --app-id <app-id> --env-id <env-id> --browser chrome
# Output results to a file
mabl run --app-id <app-id> --env-id <env-id> --output-dir ./resultsThe --await-completion flag blocks until tests finish, which is what you want in CI. Without it, the command returns immediately after triggering the run.
Data-Driven Testing in mabl
mabl supports data tables — CSV-style datasets that run a test multiple times with different input values. You define variables in your test steps using {{variable_name}} syntax:
- In the Trainer, create a test that uses variables: type
{{email}}into the email field, type{{password}}into the password field - Create a dataset in the mabl dashboard with columns matching your variable names
- Add rows of test data
- Link the dataset to your test
mabl then runs the test once per row, substituting values. This is useful for testing multiple user types, form validation edge cases, or locale variations without duplicating test logic.
For more complex data scenarios, mabl lets you extract values from HTTP API responses and use them as variables in subsequent steps — useful for tests that need to create a resource via API and then interact with it in the UI.
Managing Test Environments
mabl's environment concept maps to deployment environments (staging, QA, production). Each environment has a base URL and can have environment-specific variables.
You'd create environments in the mabl dashboard:
- Staging:
https://staging.example.com, with variableapi_base = https://api-staging.example.com - Production:
https://example.com, with variableapi_base = https://api.example.com
Tests run against a specific environment, inheriting its variables. This lets you run the same test suite against staging on every PR and against production on a nightly schedule without duplicating tests.
Interpreting mabl Insights and Reports
mabl's dashboard shows:
Test results: Pass/fail per test, per run, with screenshots and step-by-step logs for failures.
Auto-healing log: Every time mabl healed a locator, it's recorded. You can accept the healing (mabl updates the test permanently) or mark it for review. Check this regularly — frequent healing on the same element usually means a developer changed something intentionally and your test needs updating.
Flakiness score: mabl calculates a flakiness percentage per test based on how often it fails without a code change being the cause. High flakiness scores on specific tests are a signal to review timing issues or dynamic content assertions.
Performance insights: Response time trends per page/action, with anomaly detection that flags when something takes significantly longer than baseline.
Pricing Model
mabl pricing is usage-based and not publicly disclosed in detail — you need to contact sales for enterprise pricing. The general structure as of 2024-2025:
- Team plan: ~$1,000+/month (estimated), includes a set number of test runs and users
- Business/Enterprise: Volume pricing, SLA, dedicated support, SSO
There's a free trial period but no permanent free tier. This means mabl is effectively priced for teams with budget — it's not a tool you'll evaluate indefinitely on a free plan. The cost is roughly in line with other commercial testing platforms (LambdaTest, Sauce Labs) but higher than self-hosted open-source options.
Limitations
No local test files. Tests live entirely in mabl's cloud. You can export test definitions, but there's no tests/ directory to version control, code review, or grep. If mabl has an outage, you can't run your tests. This is the biggest architectural concern for teams with strict compliance or audit requirements.
Limited programmatic control. Complex logic that's easy in code (loops, conditional branching based on API responses, dynamic test generation) is awkward or impossible in mabl's point-and-click interface. Custom JavaScript steps exist but are limited in scope.
Chrome-only depth. While mabl supports multiple browsers, its AI features and auto-healing work most reliably in Chrome. Safari and Firefox support is present but less mature.
Cost at scale. For large test suites running frequently, mabl's pricing can exceed the cost of a self-hosted Selenium Grid significantly. Calculate expected run volumes before committing.
Debugging complexity. When a mabl test fails in CI, you're looking at screenshots and logs in the mabl dashboard — not a local reproduction. This adds friction when diagnosing intermittent failures.
Best Practices
Use mabl for what it's actually good at: regression testing of stable UI flows where the auto-healing saves real maintenance time. Don't force complex test logic into it.
Review auto-healing weekly. Don't let healing events accumulate without review — silent drift in test behavior is dangerous.
Keep tests short and focused. Long tests that cover multiple user journeys are hard to debug and compound flakiness. Aim for tests under 20 steps that verify one scenario each.
Use the local agent consistently for development. Don't wait until CI to discover test failures. Run mabl against your local server during development using the agent tunnel.
Tag tests well. mabl supports labels/tags. Tag by feature area, risk level, and execution frequency. This makes it practical to run a targeted smoke suite on every commit and a full regression suite nightly.
mabl is a genuinely useful tool for the team that needs AI-assisted test maintenance and is willing to pay for managed infrastructure. The auto-healing is real and saves real time. Just go in knowing it's a SaaS dependency, not a local artifact you fully control.