# Newman report with use of htmlextra fails

**URL:** <https://community.postman.com/t/newman-report-with-use-of-htmlextra-fails/36629>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [June 28, 2022, 10:43am UTC](https://community.postman.com/t/newman-report-with-use-of-htmlextra-fails/36629 "2022-06-28T10:43:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nielsej](https://avatars.discourse-cdn.com/v4/letter/n/c67d28/32.png) [@nielsej](https://community.postman.com/u/nielsej)\
**Post date:** [June 28, 2022, 10:43am UTC](https://community.postman.com/t/newman-report-with-use-of-htmlextra-fails/36629/1 "2022-06-28T10:43:59Z")

</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).

_My question_: I have put a code in the Pre-request Script for a Collection in Postman. The purpose of this code is to automatically generate a new token, for the whole Collection, when the token expires. But afterwards, when using “htmlextra” to generate a Newman report, after executing the Collection, the number of “Total Requests” and “Total Failed Tests” gets doubled up. Somebody wrote about this problem two year ago. Has there been found a solution to this problem been yet?

This is the part of the code that (apparently) causes the problem:

```
pm.sendRequest(getTokenRequest, (err, response) => {
    const jsonResponse = response.json();
    const newAccessToken = jsonResponse.access_token;   
    pm.variables.set('access_token', newAccessToken);
});

```
