General Best Practices

mabl allows you to create robust automated tests supported by machine learning, so you don't have to worry about your tests failing for the wrong reasons.

To help you use mabl to its fullest potential, we've compiled these common practices:

1. Clear your local browser storage or enable incognito for the mabl trainer

  • Your local storage may contain settings that affect the application state. mabl’s test machines will not have that state. Navigate to the “Application” tab in Chrome developer tools and clear application storage before you start training.
  • If you enable incognito for the mabl trainer your training session will start out with no cookies and a consistent initial state.

2. Add assertions when a page changes

  • After navigating to a new page, add an assertion that verifies that you have arrived at the expected page.

3. Run the same tests across multiple environments

  • Start by training your test against any application environment, just create a plan and type in a new URL to test.
  • You can include that test in separate plans for QA, staging, production, etc.

4. Provide more context when prompted

When recording a test, the trainer may prompt you to provide more context. This is necessary to get more accurate and consistent test runs. You will also have the option to opt-out from auto-healing to suit your particular use case.

5. Use variables to generate unique data for each run

  • You can define and use variables via the toolbar within the trainer.
  • You can, for example, use a variable that will always insert a random string into a field.
  • This can help you work around uniqueness requirements within your application if you’re not always setting your test environment back to a pristine state between runs.
  • Check out the Using Variables documentation for more information.

6. Make use of mabl’s auto-login feature

  • Credentials are a pain to secure and maintain. If you use mabl’s auto-login feature, you can take advantage of our enterprise-grade key management service, and you can easily update credentials across tests.
  • If you use auto-login, take care to avoid logging in during your training session; this will result in two attempts to log in, and the second one will result in a failed test.
  • When using the feature, it helps to set your Plan's URL to the login page. This will greatly speed up your initial test execution time, as mabl won't have to search for a login form.

7. Capture hovers when they are part of your test, but use them sparingly

  • You can enable “record hovers” in the mabl trainer.
  • When enabled, this adds a hover step each time your mouse hovers over an element.
  • Given that this can add many steps (which, in turn, can add significant test execution time), you shouldn’t enable it unless you are explicitly attempting to capture a hover event.
  • Hovers will not be recorded when the mouse is over the mabl trainer. If you can move the trainer partially over the element you want to hover over and then move your mouse off the trainer it, only the desired hover step will be recorded.
  • A CSS Selector or XPath can also be used to send a hover to a specific element.

8. Use the "Use strict URL prefix" parameter to restrict the link crawler if needed.

  • This is a way to avoid testing your marketing site, docs, et.
  • You can set the parameter for any plan that includes the “Visit all linked pages” test.

9. Integrate mabl with your delivery pipeline

  • It is easy to submit deployment events and retrieve plan results via mabl API
  • Information is available via Settings --> APIs.
  • This triggers any plans that are scheduled to run on deployment.
  • mabl also maintains a native Jenkins plugin.

10. If testing production, exclude mabl from your site analytics using filters for the following:

  • All requests feature the X-Mabl-Agent header, e.g. X-Mabl-Agent: Mabl/0.1
  • All User agent strings have a custom operating system property (contains mabl), e.g. Mozilla/5.0 (X11; Linux mabl) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
  • All traffic emerges from the mabl static IP address block, unless the plan environment uses mabl Link

11. Secure your test environments

Here are the ways you can limit access to the application under test.

  • You can login to your application using username and password (HTTP basic authentication)
  • You can use custom http headers and/or static IP addresses to identify traffic originating from mabl and update your firewall rules accordingly
  • A custom user agent header (x-mabl-agent) is included in all mabl HTTP requests by default. You can use this header to identify traffic originating from mabl
  • For applications deployed behind a firewall, you can use mabl Link to provide secure access to mabl

For more best practice tips, check out the webinar session below, featuring one of our Customer Success Managers, Preston Betro, that is based on feedback gathered from hundreds of mabl users and showcases the most effective ways to utilize mabl's essential functionality.

All set?

Click here to jump back into mabl to start testing!

Updated 7 days ago


General Best Practices


mabl allows you to create robust automated tests supported by machine learning, so you don't have to worry about your tests failing for the wrong reasons.

To help you use mabl to its fullest potential, we've compiled these common practices:

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.