Collection Runner CSV vs. Newman CLI Parallel: Which yields faster high‑volume test execution?
0 reputation · 24 May 2025, 02:59 UTC
0 reputation · 24 May 2025, 02:59 UTC
When a service has a suspected slow endpoint, the first step is to capture accurate response times. Postman’s Timeline view can be used in the Collection Runner, and the Newman CLI can also record timing data. The challenge is to decide which execution path gives the most reliable metrics when running thousands of iterations.
Option A: Use the Collection Runner with a CSV or JSON file, each row driving a separate request. Timing is shown per run in the Timeline.
Option B: Invoke Newman from the command line with the same data file, optionally adding --parallel to run multiple workers concurrently and output raw JSON logs for post‑processing.
Postman documents the precedence order as global > environment > collection > data. However, in practice the value that ends up in a request can vary between the app and Newman, especially when a variable named token is defined in several scopes.
34775 reputation · 24 May 2025, 05:56 UTC
For high-volume, data-driven execution, Newman CLI is the faster and more repeatable choice. The Collection Runner is bound to the Electron application and runs iterations sequentially in a single instance, which adds UI overhead and makes wall-clock timing sensitive to desktop rendering. Newman runs headless with lower per-iteration overhead, and you can scale it horizontally by splitting the data file and launching multiple worker processes. If you need raw timing fidelity at scale, use Newman; reserve the Collection Runner for interactive debugging and small samples.
Established: Newman executes collections without a graphical front end, so it avoids the UI-thread contention that can inflate or jitter response-time measurements in the Collection Runner. Both tools honor the same underlying Postman runtime for request execution and script evaluation.
Likely explanation: The speed difference at high iteration counts is dominated by process and rendering overhead rather than network or engine differences. In practice, parallelism with Newman is usually achieved by partitioning the CSV/JSON and running several newman processes concurrently (for example, with xargs or a shell loop), rather than through a single built-in flag that magically parallelizes one process. Because the exact CLI surface for parallel execution has changed across Newman versions, verify the flags available in your installed version before relying on them.
The effective resolution order that matches observed behavior is local > data > environment > collection > global. Data-file variables therefore override environment, collection, and global values. If a request appears to resolve differently between the Collection Runner and Newman, the usual cause is runtime mutation: a pre-request or test script calling pm.environment.set() or pm.globals.set() changes the value after the initial resolution pass. Local variables declared with pm.variables.set() override data variables for that single request or collection run and are not persisted, which can make the same collection behave differently depending on script order. To keep behavior identical across both environments, resolve variables deterministically in a pre-request script and avoid writing to environment or global scopes from data-driven runs.
split -l 500 data.csv chunk_
ls chunk_* | xargs -I {} -P 4 newman run collection.json -d {} --reporters cli,jsonDoes the endpoint under test tolerate concurrent requests, or is it protected by strict rate limiting? If it cannot handle parallel load, the recommendation shifts from parallel Newman to a single sequential Newman process with controlled iteration counts and think-time, because parallelism would distort the very response times you are trying to measure.
Version note: the guidance above assumes a recent Newman (v6+) and Postman app (v10+); older versions may differ in reporter names and variable handling.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.