In addition to importing API collections from Postman, you can also export mabl API tests back to Postman. The export workflow consists of three steps:
- Export a mabl API tests as a Postman collection in JSON file format
- Import the file into Postman as a new collection
- Run the collection in Postman to verify everything works
Exporting an API test
You can export a mabl API test as a Postman collection from the test details page as well as from within the API test editor. Click on the download button to download the Postman collection in JSON format.
Exporting an API test flow as Postman collection from the test details page
Managing file uploads
If your test includes file upload steps, the mabl Desktop App displays a list of the corresponding files when you export the test. You can download these files from your mabl workspace to your local machine. When you import the test into Postman, add the file(s) manually to the correct directory.
Importing into Postman
Open the Postman application and click on the Import button located around the top left area of the app. This action opens a dialog where you can upload the exported file from mabl.
Once imported, you will see the API collection within the Postman collections. If you click on a request and go to its Test tab, you may also see mabl-generated code that accounts for assertions and variables created in mabl without scripting.
If the mabl API test contained custom scripts
mabl-generated script after export to Postman
Exporting API snippets
If the mabl API test contained custom scripts, the full script is combined with comments that indicate the start and end of individual snippets
Running the collection
To ensure that everything works, run the collection in Postman. If the Postman collection run fails, check whether all external variables that the API requests rely on are present at the collection and environment level.