Capture Newman Output and Include in Email Body

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.

Hi,

I’m able to use the HTML Extra Reporter to capture our test’s results.

I then compress it and send it as an email.

This would mean that the recipient will get the ZIP file and will need to open the attachment first before getting into the actual report.

Thus, I’m thinking if I can include the number failures in the email body itself, so if there’s none, the recipient can focus on opening the attachments with failures.

Has anyone tried this? My script runs on PowerShell if it matters.

This isn’t really a Postman query if you are using PowerShell to send the email.

In your PowerShell script, you will need to import and parse the HTML report and target those elements so you can use them in your email template (before the code to compress the report).

I know a fair bit about PowerShell, but I’ve never had to work with HTML files before so I can’t tell you exactly how to parse the file (like I could if it was an CSV extract).

Couldn’t you just send the whole email as HTML, and not compress it?

Hi Mike,

Agree, was wondering if someone has done something similar before in the community.

I’ve tried sending the HTML content within the body and it shows as follows in Outlook:

image

If I view via web browser:

image

If I copy the raw message source and paste it to an HTML viewer, it’s able to view the report.

All I can recommend is to Google “powershell parse html” and have a look at some of the responses.

Reading a local HTML file can cause issues, but there are examples that might be of use for you.

Hi @michaelderekjones ,

Finally got it to work by using the JSON reporter instead and using JSONPath to extract the values I want.

Thanks!