mabl gives you a couple of ways to log into your application right away, whether you'd like to add your credentials and have mabl login automatically or if you'd like to record a manual login flow yourself.
mabl has the ability to login automatically to many applications, given that all you need to login are a username and password.
To get started, simply add the credentials you'd like to use to mabl. You can add your credentials from the "Credentials" tab in the "Configurations" page, accessible from the lefthand navigation.
Once your credentials are added, start creating your test. It's important to select the credentials you want to use at the bottom of the form, as well as turning auto login on. Be sure that you're starting from a logged out state where you don't have any cookies. Since mabl executes in the cloud and not locally, this is the best way to make sure you're recording in the same state that mabl sees your app during testing.
For the URL, you'll want to start on a page that has, at the very least, a login link. When mabl tests your app with an auto-login flow, it will automatically look for this link and navigate to it. If the link isn't present, mabl won't be able to log in at all. All you need to do now is click the "create test" button at the bottom.
Where to find the URL, "add login flow," and "credential" fields. If you choose to add the test to an existing plan, you will skip the URL field.
Now that you're at the page with the link, you're going to have to turn off recording in the trainer. Since mabl will login automatically, you won't want to record another set of login steps. If you do wish to manually record these steps, skip down to the "Recording a manual login flow" section below. Now that recording is turned off, log into your app as you normally would. As soon as you're logged in fully, turn recording back on.
Where the record button is located. Make sure to disable it before logging in. Re-enable it when finished logging in.
You're now ready to start training your test as you normally would. Be sure that recording is enabled and steps are now being logged in the trainer window.
A sample of how your test will appear after logging in without recording. Additionally, the save button is highlighted.
Recording a manual login flow in mabl is mostly the same as the above section. For security reasons, you'll still want to add your credentials to mabl. Although the mabl app and trainer are secure, the trainer gives you the ability to pass the credentials assigned to a test as variables for an additional layer of security.
Mirroring the above, simply add the credentials you'd like to use to mabl to get started. You can add your credentials from the "Credentials" tab in the "Configurations" page, accessible from the left hand navigation.
Once your credentials are added, start creating your test. It's important to select the credentials you want to use at the bottom of the form, you must not enable auto-login. Be sure that you're starting from a logged out state where you don't have any cookies. Since mabl executes in the cloud and not locally, this is the best way to make sure you're recording in the same state that mabl sees your app during testing.
For the URL, you can start on any page you'd like within your app. mabl will record all URL edits you make as well as other navigation changes. All you need to do now is click the "create test" button at the bottom.
Where to find the URL and "credential" fields. Be sure that "Add login flow" is disabled. If you choose to add the test to an existing plan, you will skip the URL field.
Now you'll be taken to your app with the mabl trainer open on the right, ready to record anything from key presses and clicks to downloaded files. Begin to use your app as you normally would, locating the login fields in app. Before you start inputing your desired username and password into the fields, find the "Use Variables" button, appearing as an (x), near the bottom of the mabl trainer. Hover over it and click the "Use Variable" button that appears.
Of the three options that appear, you'll want to select the first one titled "Input value."
Important information about iframes
If your login fields appear as part of an iframe, you'll need to switch context to the iframe before inserting the variable into the field. To do so, simply click into the text field directly before you click the "Use Variables" button. If done correctly, you'll see a "Switched context to iframe" step appear in the trainer.
mabl will now enter the element selection mode, highlighting whatever element you hover over. Click on the username input field in your login form. With the element selected, you're able to securely add those credentials you saved earlier. Select the "app.defaults.username" variable and save the step. You'll see that mabl has added the username into the field. Repeat the above steps for the password field, but instead using the "app.defaults.password" variable for that field. Now that you've added your username and password, simply click the login button and add any additional fields that may be required.
Ensure you have successfully logged into your app and that the login steps in the trainer roughly matches the following. There may be some minor differences based on the design of the app.
To re-use this login flow, you'll want to save it as a reusable flow within mabl. To do so, click the "Go to start" button at the top of the trainer, or simply use the "up" arrow key to move the purple insertion point up to before the first step.
The location of the "Go to start" button, as well as the correct position of the cursor after clicking the button.
Now, you'll want to navigate to the ellipsis shown in the bottom right of the trainer, directly above the "Save" button. Click on the ellipsis. On the new panel, click the "New Flows" button and then "Start Flow."
On the "Create Flow" screen, name your flow and select "OK" to continue. Be sure to give it a identifiable and unique name.
You'll be brought back to the main trainer window, where you can see all of your steps are now part of the flow. Use the "down" arrow key to move the cursor past the last step you'd like to include in your flow, in this case it is step 1.6. Click the ellipsis again and click the "Add flows" button again. Instead of clicking "Start flow..." you'll now click "End flow..."
Observe the "End flow" step added to your test, and save. You can exit the test now or continue recording steps after the flow.
The test is saved and the flow will now appear under the "Flows" tab of the "Tests" page. When training another test, simply use the "Add Flows" button again. Instead of starting a new flow, select "Insert Flow" and choose your newly credit login flow. You'll then want to run that flow with the play button at the top of the trainer. Then, start recording normally!
Please note that all saved edits to a flow will edit all instances of a flow, so be sure to not add any extra steps to the flow!
Important information about reusable flows
Since the above flow uses credentials that are passed as parameters, you'll need to ensure that all other tests that use this flow also have credentials enabled. Otherwise, the flow will attempt to use the parameters that do not exist, causing the test to fail prematurely.
However, you are not required to use the same credentials you used to train the original flow with. You can use any credentials you would like, assuming they are valid for your application. The flow will automatically use whatever credentials are attached to the test as parameters for that run. This means that one test can use the flow to login with the credentials of an system administrator, while another uses the credentials of a regular user.
Within mabl you can also insert an auto-login flow for tests you've previously saved the same as inserting any other flow within mabl. Inversely, you can just as easily remove any auto-login flow that you've added to a test. To accomplish this, you'll simply need to retrain the test.
Navigate to the test details page of the test you'd like to edit. Select the "Edit" button on the page, shown as a pencil icon. After clicking, you'll be brought into the trainer to start making changes.
Notice the purple bar in the trainer, it shows where you're currently inputting steps in the trainer. It should appear directly before the first step when you start editing an existing test in the trainer. Once you've confirmed that the insertion point is at the start of the test, select the ellipses from the bottom row of the trainer window. This will take you to a new panel where you'll see "Add flows" at the top. Click this, then "Insert flow..."
You'll now be taken to another new panel where you can select an existing flow to insert. Any previously saved flows will appear here, so be sure to click select the correct one. You'll be looking for the "mabl Auto Login Flow" specifically. Once selected, just click the "OK" button below.
Observe the trainer window. You'll be able to see the yellow "mabl Auto Login Flow" step added to the top. Now you're almost done.
If you're editing a previously saved test, you may already have existing login steps saved. You must delete these before saving the test. Otherwise, mabl will attempt to log into your app with auto-login and the previously saved steps, which will cause your test to fail prematurely. Once you've deleted those steps by hovering over them and clicking "x", just save the test as you normally would.
You're now all set! All instances of the test will be updated to use the auto-login flow.
Using replay with auto-login
Replay of the auto login step in the mabl Trainer is not yet supported. You will have to pause and manually login when replaying a tes locally in the mabl Trainer. We will update this doc when this feature is supported in possible future trainer updates.
Updated 2 months ago