0
0
Postmantesting~8 mins

Why Postman supports non-functional testing - Framework Benefits

Choose your learning style9 modes available
Framework Mode - Why Postman supports non-functional testing
Folder Structure
Postman Collection Project/
├── collections/
│   ├── api_endpoints.postman_collection.json
│   └── performance_tests.postman_collection.json
├── environments/
│   ├── dev_environment.postman_environment.json
│   └── prod_environment.postman_environment.json
├── scripts/
│   ├── pre_request_scripts.js
│   └── test_scripts.js
├── reports/
│   └── test_run_reports/
│       ├── functional_report.html
│       └── performance_report.html
└── postman_config.json
Test Framework Layers
  • Collections: Group API requests logically, including functional and non-functional tests.
  • Environments: Manage variables for different setups like dev, test, and production.
  • Scripts: Use pre-request and test scripts to set up data and validate responses.
  • Reports: Store test run results, including performance and load testing reports.
  • Configuration: Define global settings such as base URLs, authentication, and test parameters.
Configuration Patterns
  • Environment Variables: Use environment files to switch between servers and credentials easily.
  • Global Variables: Store reusable data like tokens or common headers.
  • Collection Variables: Define variables specific to a collection for scoped testing.
  • Data Files: Use CSV or JSON files to run data-driven tests for load or stress scenarios.
  • Postman Settings: Configure request timeouts and retries to simulate non-functional conditions.
Test Reporting and CI/CD Integration
  • Newman CLI: Run Postman collections from command line and generate JSON, HTML, or JUnit reports.
  • CI/CD Pipelines: Integrate Newman runs in Jenkins, GitHub Actions, or GitLab to automate tests on code changes.
  • Performance Metrics: Capture response times and error rates in reports to analyze non-functional behavior.
  • Alerts: Configure notifications on test failures or performance degradation.
Best Practices
  • Separate Functional and Non-Functional Tests: Organize collections to clearly distinguish test types.
  • Use Environment Variables: Avoid hardcoding URLs or credentials to enable flexible testing.
  • Leverage Data-Driven Testing: Use data files to simulate multiple users or load scenarios.
  • Automate with Newman: Run tests automatically in CI/CD for continuous feedback.
  • Monitor Performance Metrics: Track response times and failures to detect issues early.
Self-Check Question

Where in this Postman project structure would you add a new collection for stress testing the API?

Key Result
Postman supports non-functional testing by organizing collections, environments, and scripts to simulate load, measure performance, and integrate automated reporting.