Mabl credentials

Using mabl credentials in your browser tests

Mabl credentials are a special type of variable in mabl. The values of mabl credentials are encrypted with a customer-specific encryption key before getting added to our database.

This guide outlines how to create mabl credentials and use them in browser tests.

Creating mabl credentials

You can add mabl credentials by clicking on Configuration in the left-hand navigation and selecting the Credentials tab. Only owners and editors of a workspace can create mabl credentials.

2522

Adding credentials to a workspace

You can also create credentials when you create a new application:

  • In the Monitoring section, check "Automatically log in when encountering a login page"
  • Enter the username and password.

When you create the application, these credentials are used for the default link crawler and visit homepage tests for the new application. They are added to the Credentials page (Configuration > Credentials) and can be used for other user-generated tests.

Assigning mabl credentials

Tests

You can assign when creating a new browser test. The credentials appear as a dropdown in the Show advanced options section.

Plans

You can also assign credentials at the plan level:

  • Toggle on "Login credentials required."
  • Select the credentials from the dropdown.

Credentials set at the plan level override credentials set at the test level.

📘

Note

You may only assign one set of mabl credentials to a plan. All tests that use mabl credentials in a plan run - app.defaults.username and app.defaults.password - use the same set of credentials.

Training with mabl credentials

New browser tests

If a new browser test is part of an existing plan, make sure credentials are assigned at the plan level.

If the new browser test is part of a new plan or no plan, select credentials in the Show advanced options section.

Existing tests

When training an existing browser test, you can configure the training session to use a specific set of credentials in the Edit test configuration modal.

344

Mabl credentials appear in the Trainer as app.defaults.username and app.defaults.password

Running tests with mabl credentials

Plan runs

If the test is run as part of a plan, the test uses the credentials assigned to the plan. If a different set of credentials is assigned to the test, they are overridden by the credential values set at the plan level.

📘

Note

Mabl credentials are not environment-specific. If an app login requires different credentials in different environments, use environment variables to log into your app.

Ad-hoc runs

When a test is run ad hoc, you can select a set of credentials in the Ad hoc cloud run panel before triggering the test run.

📘

Ad hoc runs do not use credentials associated with a test

In order to run a test ad hoc with a set of mabl credentials, you need to add credentials in the Ad hoc cloud run panel every time you trigger a test run.

Reviewing test runs with mabl credentials

To identify which set of credentials were used in a test run, you can click on the setup step - mabl test run setup click to view logs. If credentials were passed to the test, they appear in the logs of this step.

In the following screenshot, the Test Output page shows that the "admin" credentials were used in this test run.

1407

Checking credentials on the Test Output page