Importing Postman Collections, Variables, and Environments
If you have a Postman API Collection, you can import it directly into API Testing on Sauce Labs and use it to generate tests.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license).
- An existing API Testing Project. For details on how to create one, see API Testing Quickstart.
- A Postman Collection (v2.0 or higher).
note
Looking to import from a spec file? See Building a Test from a Spec File.
Importing Postman Collections
- Log in to Sauce Labs, then click API Testing.
- Click to open one of your Projects.
- Click the HTTP Client tab.
- Click Import OpenAPI/Postman, then Import OpenAPI/Postman Collection/.har and then, select and upload your Postman Collection file from your local machine.
tip
If you don't have a file available, try out the sample below.
Click here to open a sample Postman Collection file
- Click the folder in your Snapshots tree where you'd like to save your file.
- Click Save.
- The routes from your collection will now show in the list of saved requests.
Importing Postman Environments
Postman Environments can be imported in both (Company/Project) Vault and Environments. Let's see how to do this in both cases:
Importing in Company/Project Vault
If you want to import in the Company Vault:
- Log in to Sauce Labs, then click API Testing.
- Click the Company Vault tab.
- Click Import from the Variables section.
- Select and upload your
.postman_environment.json
file.
Your environmental variables will now be available across all your Projects.
If you want to import in the Project Vault:
- Log in to Sauce Labs, then click API Testing.
- Click to open one of your Projects.
- Click the Vault tab.
- Click Import from the Variables section.
- Select and upload your
.postman_environment.json
file.
Your environmental variables will now be available in your Project.
Importing in Environments
- Log in to Sauce Labs, then click API Testing.
- Click to open one of your Projects.
- Click the Environments tab.
- Click Import.
- Select and upload your
.postman_environment.json
file.
Your environmental variables will now be available as an Environment in your Project.