# How do I display the failures details when running newman?

**URL:** <https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670>\
**Category:** Help Hub\
**Tags:** newman-project, command-line\
**Created:** [September 12, 2023, 2:59pm UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670 "2023-09-12T14:59:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![postmanerrrrrrr](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@postmanerrrrrrr](https://community.postman.com/u/postmanerrrrrrr)\
**Post date:** [September 12, 2023, 2:59pm UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/1 "2023-09-12T14:59:13Z")

</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 am running my collection using newman.cmd, I was wondering how to get the full failure details immediately. E.g. when running and a test fails something like this is output to the command line:

```auto
  1. Status code is HTTP OK
  2⠄ JSONError in test-script

```

Only once the run is over do I get the full details:

```auto
2. AssertionError Status code is HTTP OK
                            expected { Object (id, _details, ...) } to have property 'code'
                            at assertion:0 in test-script
                            inside "PostmanTest/MyRequest"

 3. JSONError Unexpected token u in JSON at position 0
                            at test-script
                            inside "PostmanTest/MyRequest"

```

How can I have these details printed to the console _immediately_ without having to wait til the run is over and then matching the numbers?

---

<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:** [September 12, 2023, 10:00pm UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/2 "2023-09-12T22:00:51Z")

</div>

Hey @postmanerrrrrrr 👋

Welcome to the Postman community! :postman:

Are you not getting that output from each request as it’s run? That’s the default behaviour on the CLI reporter.

[![](https://raw.githubusercontent.com/postmanlabs/postmanlabs.github.io/develop/global-artefacts/newman-terminal.gif) ](https://raw.githubusercontent.com/postmanlabs/postmanlabs.github.io/develop/global-artefacts/newman-terminal.gif)

---

<div class="post-metadata">

**Author:** ![postmanerrrrrrr](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@postmanerrrrrrr](https://community.postman.com/u/postmanerrrrrrr)\
**Post date:** [September 13, 2023, 8:56am UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/3 "2023-09-13T08:56:34Z")

</div>

![Untitled23](https://us1.discourse-cdn.com/getpostman/original/3X/d/9/d976df710354f4b0c111517e9fee68532f6c1f93.png)

---

<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:** [September 13, 2023, 10:20am UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/4 "2023-09-13T10:20:32Z")

</div>

Hey @postmanerrrrrrr

Newman’s cli reporter doesn’t show that information on each line, but you could run Newman in a script and print something similar to the console for each request:

```auto
newman.run({
   collection: 'Your_Collection',
   reporters: ['cli']
}).on('assertion', function (err, o) {
    if (!err) { return; }
    console.log({
        "Request Name": o.item.name,
        "Assertion Name": o.assertion,
        "Error Message": o.error.message,
        "Error Stack": o.error.stack
    });
});

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/b/1b3351b0d9c7037e0fe6477b9cab0c8bef0c3999.png)

---

<div class="post-metadata">

**Author:** ![postmanerrrrrrr](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@postmanerrrrrrr](https://community.postman.com/u/postmanerrrrrrr)\
**Post date:** [September 13, 2023, 11:02am UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/5 "2023-09-13T11:02:25Z")

</div>

> Newman’s cli reporter doesn’t show that information on each line

Ok this is pretty much the information I was looking for. I have a few more questions:

1. Are there any plans to add this functionality to cli reporter?
2. My environment file, collection file and globals file are in random locations on my local disk. Is there a way for me to run newman in a script and pass all these in using absolute paths like I can when I use newman.cmd?

---

<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:** [September 13, 2023, 11:18am UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/6 "2023-09-13T11:18:24Z")

</div>

I don’t have a view on the Newman roadmap to give you an answer to that question. All [feature requests](https://github.com/postmanlabs/newman/issues) can be created directly on that project.

You should be able to use something like this in the script for full and relative paths to files:

```auto
newman.run({
   collection: require('./collection.json'),
   environment: require('./env.json'),
   globals: require('./globals.json'),
   reporters: ['cli']
}).on('assertion', function (err, o) {
    if (!err) { return; }
    console.log({
        "Request Name": o.item.name,
        "Assertion Name": o.assertion,
        "Error Message": o.error.message,
        "Error Stack": o.error.stack
    });
});

```

Same thing can be done when using the cli:

```auto
newman run <path>/collection.json -e <path>/environment.json -g <path>/globals.json

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [September 16, 2023, 11:18am UTC](https://community.postman.com/t/how-do-i-display-the-failures-details-when-running-newman/51670/7 "2023-09-16T11:18:36Z")

</div>

Closed on September 16, 2023, 11:18am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
