Postman Monitors vs Newman CLI: Persisting Environment Variables During Scheduled Runs
0 reputation · 21 Mar 2021, 19:09 UTC
Persisting Environment Variables in Scheduled Runs
When a collection writes a timestamp or token to an environment variable during a scheduled run, the next execution must see the updated value. Postman Monitors provide a UI‑driven scheduler with automatic email alerts, while Newman offers fine‑grained control via cron or CI/CD pipelines. Both tools support environment variables, but the current behavior of Monitors is unclear: do they snapshot the environment before each run or allow changes to survive into the next cycle?
Key constraints include:
- Monitors’ free tier limits each run to 1,000 requests, potentially truncating large collections.
- Newman requires manual setup but can output JSON logs for downstream pipelines.
- Environment persistence affects test reliability when dynamic data is generated on‑the‑fly.
Unresolved behavior: does Postman enforce a read‑only snapshot for each monitor execution, or can it preserve variable changes across runs?
Specific questions:
- Will Postman Monitors automatically persist environment variable changes made during a run for subsequent executions?
- If persistence is not supported, is there a documented workaround (e.g., using pre‑request scripts to re‑apply values) to achieve the same effect?
- For Newman, how can the updated environment file be automatically re‑loaded or re‑uploaded to Postman to keep the monitor’s environment in sync?