0
0
Postmantesting~8 mins

Duplicating and moving requests in Postman - Framework Patterns

Choose your learning style9 modes available
Framework Mode - Duplicating and moving requests
Folder Structure
Postman Collection
├── Folder 1
│   ├── Request A
│   └── Request B
├── Folder 2
│   ├── Request C
│   └── Request D
└── Environment Variables
    ├── Dev Environment
    └── Prod Environment
Test Framework Layers
  • Collections: Group related requests for organization and execution.
  • Folders: Subdivide collections to manage requests logically.
  • Requests: Individual API calls with method, URL, headers, and body.
  • Environment Variables: Store dynamic data like URLs, tokens for different environments.
  • Scripts: Pre-request and test scripts to automate checks and setup.
Configuration Patterns
  • Environments: Use environment files to switch base URLs, credentials, and tokens easily.
  • Global Variables: Store values accessible across collections and requests.
  • Collection Variables: Variables scoped to a collection for modularity.
  • Request Duplication: Duplicate requests to create variations without rewriting.
  • Moving Requests: Drag and drop requests between folders or collections to reorganize.
Test Reporting and CI/CD Integration
  • Postman Test Results: View pass/fail status in the Postman app after running collections.
  • Newman CLI: Run collections from command line and generate JSON, HTML reports.
  • CI/CD Integration: Use Newman in pipelines (GitHub Actions, Jenkins) to automate API testing.
  • Report Sharing: Export and share reports with team for visibility.
Best Practices
  • Use descriptive names for requests and folders to keep collections clear.
  • Duplicate requests when testing similar endpoints with different data to save time.
  • Organize requests by feature or API resource using folders for easy navigation.
  • Keep environment variables updated to avoid hardcoding sensitive data.
  • Regularly clean up unused requests to maintain a tidy workspace.
Self Check

Where in this folder structure would you add a new duplicated request for testing a different user role?

Key Result
Organize API tests in Postman by duplicating and moving requests within collections and folders for clarity and reuse.