After run collection with powershell/Newman, can we parse error

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, 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 lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

Is there any way that after run the collection with Powershell/Newman and parse(take just that part) the error part and save at another file?

I am running my test collection in azure pipeline, for that I used newman scripts. But now I need to extract errors and create API calls for each error line. For the first step, I was planning to extract every error end of the automation test. After extracting that (maybe in another file), I plan to read each error and call API after each line.

newman run "collection_name.postman_collection.json" --environment "DEV.postman_environment.json" => probably I need to add something for extract just errors

Hey @greenridinghood :wave:

Might not be what you’re looking for but you can use Newman as a library, to access the run summary object.

You can use the different on events to access part of the data like the error messages:

A basic example script:

const newman = require('newman');

newman.run({
    collection: require('collection.json')
}).on('assertion', function (err, args) {
    console.log(args.error.message);
})

When run it pushed the failed messages to the console but you could point it to some place else and not the console.

Might not be what you’re looking for but that’s one of the ways to access the run data when using Newman.