With mabl Link, you can run tests from the mabl cloud against applications in private networks, and author tests against them in the mabl Desktop App or with the mabl agent. Once a Link Agent is connected, configure your workspace to send test traffic through its tunnel.
This article explains how to…
- Route test traffic through mabl Link
- Route a run through your own computer
- Train tests over a Link tunnel
- Author tests with the mabl agent over a Link tunnel
- Run tests locally over mabl Link
- Stop routing test traffic through mabl Link
- Override the Link tunnel in a deployment event
Routing test traffic through mabl Link
Before you configure tests to run over mabl Link, make sure the Link Agent shows a Connected status on the networking page: Settings > Networking. If you don't see a connected Link Agent, see Link Agent setup and Troubleshooting issues with mabl Link.
mabl Link is configured at the environment level. When you associate a Link tunnel with an environment, every plan and test run in that environment sends its traffic through the tunnel. If only some of your testing environments are private, create a dedicated environment in mabl for the tests that need mabl Link.
Add Link to an existing environment
To configure an existing environment to use mabl Link, go to the environments page, Configuration > Environments, and take the following steps:
- Open the environment you want to use with mabl Link.
- Click the edit pencil.
- Check the Use link agent box.
- Select one or more tunnels from the mabl Link agent list.
- Save your settings.
Routing test traffic through mabl Link
The list includes your workspace's own tunnels and any company-scoped tunnels that every workspace in your company can use. If you select more than one tunnel, mabl sends each connection through one of them and tries another if the first can't reach the destination.
Add Link to a new environment
To create an environment that uses mabl Link, go to the environments page, Configuration > Environments, and take the following steps:
- Click + Add environment.
- Give your environment a name.
- Check the Use link agent box.
- Select one or more tunnels from the mabl Link agent list.
- Save your settings.
Database connections
Database queries can use a Link tunnel too. Set a mabl Link Agent override on the database connection, or run the queries in an environment that uses mabl Link. See Querying private databases.
mabl Link in test output
When tests run in the mabl cloud over mabl Link, the Link Agent host in your network resolves the URLs. At the start of the test output, a line names the tunnels the run uses:
Link tunnels: {tunnel-name}
If your Link-enabled test and plan runs have problems, see Troubleshooting issues with mabl Link for tips on isolating the issue.
Routing a run through your own computer
To run a cloud test against something only your computer can reach, such as a development build, route the run through a personal Link tunnel. Start a personal tunnel on your computer, then select Route test traffic through my computer when you start the run.
A run that uses your personal tunnels goes only through them. The environment's own Link tunnels aren't used for that run. Personal tunnels are meant for ad hoc runs you start yourself. For deployment events and CI/CD pipelines, use a workspace or company tunnel.
Training tests over a Link tunnel
When you train a browser test in the mabl Desktop App, the training browser can reach your application through a Link tunnel. Use it to train tests against private environments that your own computer can't reach, such as a staging environment inside another network. Training over a Link tunnel is available with Link 3.0.
Before you start
- Use the mabl Desktop App version 2.71.0 or later. An older version shows a message asking you to update.
- The workspace needs a Link tunnel with a Link Agent connected over Link 3.0. Tunnels whose agents only use the legacy protocol aren't listed. See Migrating from legacy Link to Link 3.0.
- Your role must be allowed to access Link tunnels. A workspace owner sets that in Settings > Networking > Link tunnel access. See Controlling access to Link tunnels.
Train over a Link tunnel
- In the mabl Desktop App, start training a new browser test, or open an existing test to edit it.
- In the training configuration, expand Optional configurations.
- In the mabl Link section, select Train over a mabl Link tunnel.
- Choose the tunnel from the Link tunnel list. The list starts with the first connected tunnel of the environment you chose, if the environment uses mabl Link.
- Launch the trainer.
While the trainer starts, it shows Connecting to mabl Link.... Once it opens, the training browser's traffic goes out from the network where the selected tunnel's Link Agent runs. DNS names are resolved there too, so the trainer reaches the same hosts your cloud runs reach through that tunnel.
You choose the tunnel each time you launch the trainer. mabl doesn't save it with the test. To run the test in the cloud over the same tunnel, configure its environment to use mabl Link.
Training over a Link tunnel applies to browser tests. mabl Link is not available for mobile cloud training.
If the tunnel isn't available
| Message | What to do |
|---|---|
| No Link tunnel in this workspace has a connected agent to train through. | Start a Link Agent on a tunnel, or check that an existing agent is connected over Link 3.0 on Settings > Networking. |
| This workspace's Link tunnel access does not include your role. | Ask a workspace owner to add your role under Settings > Networking > Link tunnel access. |
| Training over a mabl Link tunnel requires desktop app version 2.71.0 or later. | Update the mabl Desktop App. |
Authoring tests with the mabl agent over a Link tunnel
When the mabl agent creates or edits a test in the cloud, it sends the session's browser traffic through the Link tunnels of the environment you choose, the same way a cloud run does. The environment needs mabl Link turned on with at least one Link Agent label, as described in Routing test traffic through mabl Link.
Where you set the environment depends on how you start the session:
- In the web app, choose the environment in the Test information section of the planning chat before you select Generate.
- With the mabl MCP, pass the environment to the cloud authoring tool.
- With the mabl CLI, pass the environment to the cloud authoring command.
If no Link Agent with the environment's label is connected when the session starts, the agent posts Unable to connect to Link tunnel in the session and continues without mabl Link. The session then fails when the browser can't load your application. Start a Link Agent for that label and start the session again.
Running tests locally over mabl Link
A test that you run locally with the mabl CLI can also send its traffic through mabl Link, which lets a local run reach a private environment your computer can't reach directly. Add --via-link to mabl tests run:
# Use the environment's Link tunnels
mabl tests run --id {test-id} --environment-id {environment-id} --via-link
# Use a specific tunnel instead
mabl tests run --id {test-id} --via-link --link-tunnel qa-env-01
You can repeat --link-tunnel to use more than one tunnel, and it replaces the environment's tunnels for that run. Local runs over mabl Link require Link 3.0, and your role must be allowed in Link tunnel access unless the CLI is signed in with an API key.
Disabling mabl Link for a test environment
To stop routing test traffic through mabl Link, turn off Link for the environment:
- Go to the environments page in the mabl app: Configuration > Environments.
- Open the environment you want to update.
- Click the edit pencil to open the Edit environment page.
- Uncheck the Use link agent box.
- Save your settings.
Tests and plans that run in this environment no longer connect to the application under test through mabl Link. The mabl cloud resolves the addresses instead.
Overriding the Link agent name in a deployment event
In some scenarios, such as when a developer needs to test against a local development environment, you may need to temporarily override the tunnel that an environment uses. With mabl deployment events, you can override the configured tunnels for an environment by passing different tunnel names.
To override the tunnels used in a deployment event, add the following parameter to the JSON request body:
"plan_overrides":{"link_agent_labels":["your-tunnel-name-here"]}
link_agent_labels is a list of tunnel names. It replaces link_agent_label, a single name, which is deprecated.