0
0
Postmantesting~8 mins

Collection runner results in Postman - Framework Patterns

Choose your learning style9 modes available
Framework Mode - Collection runner results
Folder Structure
postman-project/
├── collections/
│   └── api-collection.json
├── environments/
│   ├── dev.postman_environment.json
│   ├── staging.postman_environment.json
│   └── prod.postman_environment.json
├── reports/
│   └── collection-run-results.json
├── scripts/
│   ├── pre-request-scripts.js
│   └── test-scripts.js
├── postman.config.json
└── README.md
Test Framework Layers
  • Collections: Define API requests and workflows to test endpoints.
  • Environments: Store variables like base URLs and credentials for different setups.
  • Scripts: Pre-request and test scripts to set variables and assert responses.
  • Reports: Store results from collection runs for analysis and debugging.
  • Config: Postman configuration file to manage runner options and global settings.
Configuration Patterns

Use environment files to switch between dev, staging, and production easily. Store sensitive data like API keys in environment variables, not in collections. Use postman.config.json to define runner options such as iteration count, delay between requests, and data files for data-driven tests.

Test Reporting and CI/CD Integration

Run collections via Postman Collection Runner or Newman CLI to generate JSON or HTML reports saved in the reports/ folder. Integrate Newman runs into CI/CD pipelines (e.g., GitHub Actions, Jenkins) to automate tests on code changes. Use reports to track pass/fail status, response times, and assertion details.

Best Practices
  • Keep collections modular and focused on specific API areas.
  • Use environment variables to avoid hardcoding sensitive data.
  • Write clear and simple test scripts with meaningful assertions.
  • Store reports systematically for historical test result tracking.
  • Integrate collection runs into CI/CD for continuous feedback.
Self Check

Where in this folder structure would you add a new environment file for testing a new QA environment?

Key Result
Organize Postman tests with collections, environments, scripts, and reports for clear, automated API testing.