beginner·6 min read·Updated Oct 24, 2026

Import API Test Cases Using Postman: From Collection to Tests

Your Postman collection is a test plan too. Import it into Shift-Left API, see what each folder, request and script becomes, and run an imported test.

This is lesson 9.4 of Shift-Left API in Depth, the product track of the learning center. For the demo, use the free edition of Shift-Left API (Postman collection import is in every edition) and a Postman collection written for the public sandbox store API.

How do you import API test cases using Postman?

You may already have API test cases using Postman: a collection full of requests, with test scripts that check each response. You don't have to write them all again. In lessons 9.1 to 9.3, the store API's tests came from its spec. Plenty of teams start somewhere else, with a collection they've grown for years. That collection is a test plan too, and Shift-Left API can import it.

How to create API test cases in Postman

Here's how to create API test cases in Postman that import cleanly:

  • Save each request in a folder.
  • Add a test script that checks the response, with pm.test and pm.expect: the status code, a field, the response time.
  • When a later request needs a value, like the ID of a user you just created, save it in the script with pm.environment.set.

One rule decides what becomes a test: does the request check its response? A request with a test script is a test case. A request without one is just a saved request. It says nothing about what a correct answer looks like, so it isn't imported as a test until you ask for it.

What each part of a collection becomes

In PostmanIn Shift-Left API
Top-level folderFeature
RequestEndpoint (requests that share a method and path share one endpoint)
Request's test scriptTest
Checks in the scriptAssertions
Value the script savesData extraction
Base URL variableThe project's base URL

The collection in this lesson has three folders, Products, Users and Orders, for the sandbox store. The Products and Users requests have test scripts; the two Orders requests don't.

Import the collection

  1. Create an empty project (the demo calls it Store API Postman) and click Endpoints in the sidebar.
  2. Leave the API type on Auto-detect. A collection is a file, so click Upload File.
  3. Click the drop zone and pick the collection. Auto-detect reads it as a REST API.
  4. Click Import File.

Read the import summary

The import ends with a summary. For this collection: six tests imported, and all twelve assertions converted, so every check in the test scripts now runs here. One value the collection saves for later requests is captured too.

Then read the next part carefully. Two requests weren't imported as tests, because they carry no test script. You can import them anyway, each one expecting a 200 response, or click Keep it as it is. The demo keeps it as it is.

Shift-Left API then shows the API spec it built from the collection. Each top-level folder became a section, and the requests inside became endpoints, each with its method and path. Click Close.

See what each part became

Back on the project page, each folder is a feature: Products, Users and Orders, with two endpoints each. Products and Users have three test cases each; Orders has none.

  1. Click Users, then Create a user. Two requests in the collection call POST /api/v1/users, so they became one endpoint with two tests: one without an email, and one that creates a user. Every test says where it came from: imported from Postman, then the folder and the request's name.
  2. Click the pencil on Create a user, then Assertions. The script's two checks are now two assertions: status code equals 201, and data.email equals ada@example.com.
  3. Click Data. The line that saved the new user's ID is now a data extraction, userId, read from data.id, ready for the requests that use it.
  4. Click Auth. Authentication isn't part of this collection. If yours has some, set it up here, as an authentication profile.
  5. Click Run at the top right. The test passes: both checks hold against the live sandbox.

Close the test and click Orders. Its requests had no test scripts, so it came in with two endpoints and no tests. Generate Tests for All fills that gap, from the spec the import just built.

Try it yourself

Download this lesson's sample API test cases using Postman, store-api.postman_collection.json (the three-folder collection described above), create an empty project, and import it with Upload File. How many tests and assertions does the summary report, and which requests were left out? Then open Create a user and run it.

Recap

  • API test automation with Postman lives in your collection: requests in folders, and test scripts that check each response.
  • Import API test cases using Postman into Shift-Left API, and folders become features, requests become endpoints, and each script becomes a test with real assertions; saved values become data extractions.
  • Requests without a script are left out until you choose to import them.

Next, in lesson 9.5, you generate tests for the endpoints the collection didn't cover, with coverage-driven strategies and the AI Generation settings. For more on building tests in Postman itself, read how to use Postman for API testing.

Hands-on lab

Try it: Create an empty project, import the lesson's Postman collection with Upload File, read the import summary, then open Create a user and run it.

Enter your email to open the lab steps. One unlock opens every lab in the learning center.

No spam. Protected by reCAPTCHA — Google Privacy & Terms.

Frequently asked questions

Can you import API test cases using Postman into Shift-Left API?+

Yes. Upload the collection file and each top-level folder becomes a feature, each request an endpoint, and each request's test script a test whose checks become assertions. Postman collection import is in every edition of Shift-Left API, including the free one.

How do you create API test cases in Postman that import cleanly?+

Save each request in a folder and give it a test script that checks the response with pm.test and pm.expect: the status code, a field, the response time. When a later request needs a value, save it with pm.environment.set; on import it becomes a data extraction.

What happens to Postman requests without a test script?+

They aren't imported as tests by default, because they say nothing about what a correct answer looks like. They still become endpoints, and the import summary lists them. You can choose to import them anyway, each one expecting a 200 response.

Related lessons

Read more on the blog