0
0
Postmantesting~5 mins

Collections and folders in Postman

Choose your learning style9 modes available
Introduction

Collections and folders help you organize your API tests in Postman. They keep your tests neat and easy to find.

You want to group related API requests together for a project.
You need to run a set of tests in a specific order.
You want to share a group of API tests with your team.
You want to separate tests by feature or module.
You want to save and reuse tests later.
Syntax
Postman
Collection {
  Folder {
    Request1
    Request2
  }
  Request3
}

A Collection is a container for folders and requests.

A Folder groups related requests inside a collection.

Examples
This example shows a collection named 'User API' with two folders: 'Login' and 'Profile'. Each folder has requests related to that feature.
Postman
Collection: User API
  Folder: Login
    Request: POST /login
  Folder: Profile
    Request: GET /profile
A collection with requests directly inside it, without folders. Good for small sets of tests.
Postman
Collection: Shopping Cart
  Request: GET /cart
  Request: POST /cart/add
Sample Program

This is a simple setup in Postman where you create a collection and folder, add requests, and run them to test your API.

Postman
// Create a collection named 'Todo API'
// Add a folder named 'Tasks'
// Add two requests inside 'Tasks' folder

// Request 1: GET /tasks
// Request 2: POST /tasks

// Run the collection to test the API endpoints
OutputSuccess
Important Notes

Use descriptive names for collections and folders to find tests easily.

You can export collections to share with others or import collections shared by teammates.

Folders help run a subset of requests inside a collection.

Summary

Collections group your API tests in Postman.

Folders organize requests inside collections.

Use them to keep tests clear, reusable, and shareable.