Import from Postman

You can create an API test in mabl by importing a Postman Collection (JSON file), including the JavaScript code available within the Pre-request and Tests sections of requests.

25602560

Example of a Postman Collection

In Postman

  1. Open a Collection that you'd like to import to mabl.
  2. Click on the More actions (...) menu.
  3. Select Export. Postman will ask you which collection format you would like to save the exported file in. You can proceed with the export without changing the default setting.
970970

Exporting a Postman Collection

🚧

Collection size limits

Please note that API tests cannot exceed 1MB in size. We recommend using caution with large JavaScript pre-request scripts.

In mabl

  1. Click the New test button in the left sidebar.
  2. Select API test.
20722072

Choosing what test type to create in mabl

  1. Fill out the test creation form. (Note that you may need to configure a base API URL for your mabl application/environment, if you haven't done so already.)
  2. Click on Create test. You will be presented with the API Test Editor.
30123012

Importing Postman Collection into mabl to create a mabl API test

  1. Click on the Import icon. You will see the API requests from Postman have been converted to mabl test steps that you can review.
38403840

Example of a mabl API test imported from Postman

Working with variables

Postman users often make use of variables to store and reuse dynamic values with the request body, pre-request and test scripts.

📘

Variable notaion

You can use the Postman variable notation {{variableName}} when working with API test variables in mabl.

There are five different variable types in Postman that you need to be mindful of when importing an existing Collection to mabl. This graphic provides an overview of how Postman variables map to variables in mabl:

20972097

Variables mapping between Postman and mabl

Given this variables mapping, you may need to take the following actions:

  • Environment variables in Postman will need to be defined for each environment in mabl.
  • Global variables in Postman will need to be defined either at environment level in mabl or added to the Postman Collection that is being exported.
  • Postman Collection-level variables will be automatically imported and associated with the respective mabl API test. You will see them on the test details page under the data-driven variables section.
  • If you use Postman data-level variables, such as pm.iterationData.get("variable_name"), within your requests, you will need to create a DataTable in mabl and associate it with the respective API test. When the test runs, mabl will assign values to the pm.iterationData variables based on matching variables names from the DataTable.
  • Any Postman local variables will be considered test-generated variables in mabl and as such will be passed to the following API requests as well as shared with other tests within the plan, if sharing variables is enabled for the test.

📘

Importing CSV or a JSON file with test data

Test data in CSV or JSON files needs to be converted to a mabl datatable in order to be used with imported Postman Collections in mabl. You can easily create a mabl datatable from a CSV file import, however JSON file format is not supported at the moment.

Importing a base URL

Mabl applications use a base API URL that is assigned to a system-level variable called api.url. We recommend you use the same api.url variable name for the base URL within your Postman collection so that it is easier to import/export collections between mabl and Postman.

15541554

That way, when you import the Postman collection into mabl, the URL for API requests will be automatically composed based on the configured api.url values for the mabl environments.

Postman dynamic variables

Postman also has the notion of dynamic variables that can help you generate dummy data for your API requests. Such dynamic variables will work as expected with with mabl.

Postman folders

Postman allows you to organize your testing using folders. Unfortunately, we do not support importing collections with folders at this time.


Did this page help you?