# The newman summary gives incorrect numbers of requests,pre request,test-script count

**URL:** <https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698>\
**Category:** Help Hub\
**Tags:** newman-project, tests, collections\
**Created:** [August 4, 2020, 8:27am UTC](https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698 "2020-08-04T08:27:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SajinaPM](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SajinaPM](https://community.postman.com/u/SajinaPM)\
**Post date:** [August 4, 2020, 8:27am UTC](https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698/1 "2020-08-04T08:27: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 collection has 14 requests which also includes prerequisite script for each.

 ![newmanCollection](https://us1.discourse-cdn.com/getpostman/original/2X/c/c21eae6ffa76a158442897f35e5d9a7299ff7db5.jpeg)

But the summary of the report gives a count of 28(which is 14\*2) for not jusr request,but also for pre requisite script and tests

 ![newmanSummary](https://us1.discourse-cdn.com/getpostman/original/2X/9/98584bd64f1f37c7e8cc4e0a36f9be4213d5dba7.jpeg)

Also my test script looks as follows  
\> pm.test(“Status code is 200”, function () {

> ```
> pm.response.to.have.status(200);
> 
> ```
> 
> });  
> var jsonData = pm.response.json();  
> var name = “STEM”
> 
> pm.test(“Validate the mode of Dictionary”, function () {
> 
> ```
> pm.expect(_isContains(jsonData, "mode", name)).to.be.true;
> 
> ```
> 
> });
> 
> function \_isContains(json, keyname, value) {  
> return Object.keys(json).some(key =\> {  
> return typeof json[key] === ‘object’ ?  
> \_isContains(json[key], keyname, value) : key === keyname && json[key] === value;  
> });  
> }

But the html report shows number of test+1

 ![htmlreport](https://us1.discourse-cdn.com/getpostman/original/2X/0/05536d8a3f14e7deaf1a398494ae9d4f958a278f.jpeg)

---

<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:** [August 4, 2020, 1:04pm UTC](https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698/2 "2020-08-04T13:04:32Z")

</div>

Hey @SajinaPM

Welcome to the community! 👋

Are you using the `sendRequest()` function in the collection scripts anywhere?

The images are great but they don’t really tell the whole story so it’s difficult to advise you -  
What command are you running with Newman? Are any data files involved here?

Has the collection file changed at all since you exported this to us in Newman?

More information about the what you’re doing will help a lot but without that it’s just a game of guessing ☹

---

<div class="post-metadata">

**Author:** ![SajinaPM](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SajinaPM](https://community.postman.com/u/SajinaPM)\
**Post date:** [August 4, 2020, 1:43pm UTC](https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698/3 "2020-08-04T13:43:33Z")

</div>

Due to character limitation,am unable to add the collection json here for ur reference.  
I didn’t make any changes to the collection json.

The command used to run collection was

> newman run ND-142.postman\_collection.json --insecure

And to get the html report I used the below command

> newman run ND-142.postman\_collection.json --insecure -r htmlextra

Am using pre-requisite scripts where request is sent to get the authorization token.  
And I absorbed that when I removed the pre-requisite script for a request from the collection,the total request decreased by 1.

If the requests count shows both actual request and prerequisite request then

1. Why do we have the other stats called prerequisite script count ?  
2.Why is pre-requisite scripts shown as 28 when I have only 14 requests?

Also in html reports the number of tests shows 2 where in I have only one test to check the status code.

---

<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:** [August 4, 2020, 1:48pm UTC](https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698/4 "2020-08-04T13:48:20Z")

</div>

The reporter is reporting what’s coming through from Newman - There’s a wider issue around using the `sendRequest()` function in the collection and the reporting of that from Newman.

I have an open issue on the reporter that might provide some more context:

> <https://github.com/DannyDainton/newman-reporter-htmlextra/issues/241>
>
> Describe The Problem
> When using pm.sendRequest, the test count in "Total Requests"\>request\>"TEST INFORMATION" is doubled (same test is displayed with count 2).
> The...

---

<div class="post-metadata">

**Author:** ![SajinaPM](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SajinaPM](https://community.postman.com/u/SajinaPM)\
**Post date:** [August 4, 2020, 1:48pm UTC](https://community.postman.com/t/the-newman-summary-gives-incorrect-numbers-of-requests-pre-request-test-script-count/14698/5 "2020-08-04T13:48:48Z")

</div>

The json for one request is as below

> {  
> “name”: “ND-379|SetupDictionary|REGULAR mode”,  
> “event”: [  
> {  
> “listen”: “prerequest”,  
> “script”: {  
> “id”: “da3c3087-6422-4fd7-b665-2ae2e838f4c4”,  
> “exec”: [  
> “pm.sendRequest(\r”,  
> “{url:pm.collectionVariables.get(‘Auth url’),\r”,  
> “method: ‘POST’,\r”,  
> “header:‘Content-Type:application/json’,\r”,  
> “\r”,  
> “\r”,  
> “body: {\r”,  
> " mode: ‘raw’,\r",  
> " raw: JSON.stringify({ username: "peter\_parker", \r",  
> " password: "spider@123" })\r",  
> “\r”,  
> " \r",  
> “\r”,  
> “}\r”,  
> “}\r”,  
> “, function (err, response) {\r”,  
> " \r",  
> " var token=response.text().replace(/(\r\n|\n|\r)/gm,"");\r",  
> " pm.collectionVariables.set("token",token);\r",  
> " \r",  
> “});”  
> ],  
> “type”: “text/javascript”  
> }  
> },  
> {  
> “listen”: “test”,  
> “script”: {  
> “id”: “d0e21902-595f-4763-ad29-cb0e313c130c”,  
> “exec”: [  
> “pm.test("Status code is 200", function () {\r”,  
> " pm.response.to.have.status(400);\r",  
> “});”  
> ],  
> “type”: “text/javascript”  
> }  
> }  
> ],  
> “request”: {  
> “method”: “POST”,  
> “header”: [  
> {  
> “key”: “Authorization”,  
> “value”: “{{token}}”,  
> “type”: “text”  
> }  
> ],  
> “body”: {  
> “mode”: “raw”,  
> “raw”: “{\r\n "mode": "REGULAR",\r\n "app\_name": "app-qa"\r\n}”,  
> “options”: {  
> “raw”: {  
> “language”: “json”  
> }  
> }  
> },  
> “url”: {  
> “raw”: “{{api\_url}}/search/dictionary/mode”,  
> “host”: [  
> “{{api\_url}}”  
> ],  
> “path”: [  
> “search”,  
> “dictionary”,  
> “mode”  
> ]  
> }  
> },  
> “response”:   
> }
