# Running collection for comparing different environments

**URL:** <https://community.postman.com/t/running-collection-for-comparing-different-environments/87275>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [December 6, 2025, 10:43pm UTC](https://community.postman.com/t/running-collection-for-comparing-different-environments/87275 "2025-12-06T22:43:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![security-geologist-6](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@security-geologist-6](https://community.postman.com/u/security-geologist-6)\
**Post date:** [December 6, 2025, 10:43pm UTC](https://community.postman.com/t/running-collection-for-comparing-different-environments/87275/1 "2025-12-06T22:43:18Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

I have a Postman collection for a service with two environments: `legacy` and `migrated`. My goal is to run the same collection against both environments using Newman and compare the outputs to ensure the migrated service behaves identically to the legacy one. I need to use data files with test cases for specific endpoints.

## Question 1: Running specific requests with iteration data

Is there a way to tell Newman to run **only specific requests** from a collection when using data files (besides using `pm.execution.skipRequest()` inside the collection itself)?

The issue I’m facing: even if my iteration data file contains variables used by only one specific request, Newman still executes **all requests in the collection** on each iteration. This results in unnecessary executions and makes it difficult to test specific endpoints with their dedicated test data.

**What I’ve tried:**

- Using `--folder` option (works for folders, but not for individual requests)

- Conditional skipping with `pm.execution.skipRequest()` (requires modifying the collection)

**What I need:**

- A CLI option or approach to run specific request(s) with their data files without executing the entire collection

- Preferably without modifying the collection scripts themselves

**Example scenario:**

```bash

# I want something like this:

newman run collection.json \\

  -e legacy-env.json \\

  -d endpoint-a-testcases.csv \\

  --request "Endpoint A Request" # This option doesn't exist

```

## Question 2: Automated tools for comparing Newman outputs

Besides writing custom scripts, are there any **automated tools or Newman reporters** that can compare outputs between two collection runs?

**My use case:**

1. Run collection with `legacy-env.json` → save results

2. Run collection with `migrated-env.json` → save results

3. Compare responses (status codes, headers, body) between the two runs

4. Generate a diff report

**What I’m looking for:**

- Built-in Newman reporters or plugins for response comparison

- Recommended tools/libraries for snapshot testing with Newman

- Best practices for regression testing between environments

**I’ve looked at:**

- `newman-reporter-htmlextra` (great for individual run reports)

- `newman-reporter-json` (gives raw data, but requires custom parsing)

But I haven’t found a solution specifically designed for **comparing multiple runs** or **snapshot testing**.

## Additional context

This is for migration validation where we need to ensure the new (migrated) system produces identical responses to the old (legacy) system across hundreds of test cases. Any guidance on:

- Newman best practices for this scenario

- Existing tools or patterns

- Alternative approaches

Would be greatly appreciated for any help

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [December 9, 2025, 10:41am UTC](https://community.postman.com/t/running-collection-for-comparing-different-environments/87275/2 "2025-12-09T10:41:33Z")

</div>

Hey @security-geologist-6 👋

Welcome to the Postman Community! :postman:

You can use the `--folder` flag in Newman to pass individual request names and it it run those if they are unique.

```auto

newman run collection.json -e legacy-env.json -d endpoint-a-testcases.csv --folder "Request Name" 

```

I don’t know the structure of your data file, to know what will actually be executed for that run.

The [Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/) can also be used to run individual requests based on their id or name

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/8/58cfcae7285125a7918c5614ee58b60a9857cdee.png)

* * *

There isn’t a tool that I can think of that will allow you to compared the 2 outputs but I’m sure a scripts could be created that will check both files and give you to differences.
