If your test environment is protected by HTTP basic auth, you can configure your tests to send those credentials at the HTTP layer with all requests to your test site during execution. This article explains how to work with basic auth credentials in mabl tests:
Add basic auth credentials to mabl
To use basic auth credentials in a test run, create a new set of mabl credentials on the credentials page of the mabl app: Configuration > Credentials. Click on the + New credentials button and add the credential name, description (optional), username, and password. Then save the credentials.
Apply basic auth credentials to tests
Basic auth credentials may be applied at the plan level or the test level. They are supported in both authoring and execution.
Plan settings
You can configure basic auth credentials either as a default for the entire plan run or as a test-specific override.
To set basic auth credentials at the plan level, edit the plan and scroll to the Browser device settings section. Click on Additional settings and toggle on “HTTP basic auth required”. Select your credentials from the dropdown and save your settings.
To assign basic auth credentials for an individual test within a plan run, update its test variables on the plan settings page. If you are on the Edit plan page, you’ll first need to click on the Show tests button to access individual tests.
In the Test variables panel, click on + Add parameter and set the Type field to “Basic HTTP Auth” and select your credentials from the dropdown.
During authoring, the Trainer inherits the basic auth credentials as they are configured in the plan.
Test settings
For a test that isn't part of a plan, you can apply basic auth settings when creating a new test or editing an existing test.
The credential gets applied during Trainer sessions and agent sessions. You can also configure it in local and cloud-based ad hoc test runs.