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

My collection has 14 requests which also includes prerequisite script for each.
newmanCollection

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

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

Hey @SajinaPM

Welcome to the community! :wave:

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 :frowning:

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.

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:

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”:
}