# TestScript requests appear as main request in the reports

**URL:** <https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041>\
**Category:** Help Hub\
**Tags:** newman-project, newman-reports, test-script\
**Created:** [January 29, 2024, 12:49pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041 "2024-01-29T12:49:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![security-explorer-92](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@security-explorer-92](https://community.postman.com/u/security-explorer-92)\
**Post date:** [January 29, 2024, 12:49pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/1 "2024-01-29T12:49:26Z")

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

Hello,

If I send another request inside the Test Script, and run the collection via Newman, instead of the information of main the request , the information of the request in the Test Script returns in the Postman Cloud report and HTML report. Has anyone encountered such a problem?

**For example:**  
Main request: GET baseUrl/user  
Test Script: DELETE baseUrl/user (used pm.sendRequest)

**In the report:**  
DELETE baseUrl/user appears as the main request in the report.

Thank you in advance

---

<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:** [January 29, 2024, 1:52pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/2 "2024-01-29T13:52:32Z")

</div>

Hey @security-explorer-92 👋

Depending on the HTML reporter that you’re using, if it’s htmlextra, it won’t show those async requests are a separate request in the report. There’s also known issues with the report around the number of tests shown when using `sendRequest()`.

Would you be able to provide more details and visual examples of your problem, please?

---

<div class="post-metadata">

**Author:** ![security-explorer-92](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@security-explorer-92](https://community.postman.com/u/security-explorer-92)\
**Post date:** [February 1, 2024, 1:07pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/3 "2024-02-01T13:07:24Z")

</div>

Thank you Danny,

I have a test collection consisting of 8 requests, and in the pre-request and test scripts of the 4th request, I’m sending a post request using `pm.sendRequest()`. When I run this collection through Postman, the 8 requests work sequentially, and the report in the Postman UI is accurate. So far, there is no problem.

**requests and pre-req script:**

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/7/a772d68576ea340cbb084623d7d8363adf0b7b81.png)

**requests and test script:**

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/0/e052a444f9dbf5a3386a76256a803e466a76e45a.png)

**postman runner report:**

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/b/8b87f11301190b5d2fe7818afea9482313a0eb90.png)

However, if I run this collection with Newman, it counts each `pm.sendRequest()` as a separate request, and in the terminal, I see that 10 requests were made instead of 8. I’m using htmlextra and postman-cloud for reporting. When I look at both reports, it appears as though 10 requests were made. The most problematic part is this: the main 4th request, its pre-request and test script, including 3 requests, appear as if they were the same request. Whichever request is made last, all 3 requests appear as that last request. Normally, the 4th request was a GET request, but since a POST request was made in the last test script, all requests related to this request appear as the POST request made in the test script.

**terminal after newman command:**

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/4/d/4df283b7b7adf57c916f7ca34558885f7360e007.png)

**Report uploaded to postman-cloud:**

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/9/59057509949bfbe207a9227efa10dd7eff0c4a77.png)

**Html report:**

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/b/eb931e4809d13e53c22b2b90047980533f31180c.png)  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/d/b/db59a4a3931e59240f245ed7ad8ae71e09f7318e.png)  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/2/f25b84e31b1e062498b264ad97773758edc9d4fc.png)

Thank you in advance

---

<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:** [February 1, 2024, 7:43pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/4 "2024-02-01T19:43:03Z")

</div>

Hey @security-explorer-92 👋

As I mentioned in the previous message, there are known issues around `sendRequest()` and the data coming into the reporter from Newman.

> <https://github.com/DannyDainton/newman-reporter-htmlextra/issues/241>
>
> \*\*Describe The Problem\*\*
> When using pm.sendRequest, the test count in "Total Re…quests"\>request\>"TEST INFORMATION" is doubled (same test is displayed with count 2). 
> 
> The "TOTAL ASSERTIONS" and the "TOTAL FAILED TESTS" on the Summary page are displayed as expected, but the "Prerequest Scripts" and the "Test Scripts" have the wrong count.
> 
> \*\*Steps To Reproduce\*\*
> 1. Add additional request to the (for example) Test tab like:
> 
> \`\`\`javascript
> pm.sendRequest("https://postman-echo.com/get", function (err, response) {
> console.log(response.json());
> });
> \`\`\`
> 
> 1. Run the collection
> 2. Open the generated report
> 3. Verify the "Prerequest Scripts" and the "Test Scripts" count
> 3. Navigate to "Total Requests"\>someRequest\>"TEST INFORMATION" and verify the number of test displayed
> 
> The command that you're using to run the collection, would be a real help or the \`newman\` script, if you're using one.
> 
> \`\`\`console
> newman run C:\\someFolder\\someCollectionName.postman\_collection.json --reporters cli,html,junit,htmlextra --reporter-htmlextra-export C:\\someFolder\\Report.html --reporter-htmlextra-logs --timeout-script 90000 --color off
> \`\`\`
> 
> \*\*Screenshots and Gifs\*\*
> !\[image\](https://user-images.githubusercontent.com/18331073/86019735-a2749500-ba2f-11ea-80d9-4b66450aeedf.png)
> 
> !\[image\](https://user-images.githubusercontent.com/18331073/86019772-b1f3de00-ba2f-11ea-894e-5cabe4bf6480.png)
> 
> 
> 
> \*\*Collection and Environment Files\*\*
> 
> 
> \*\*Version and Platform Information:\*\*
> - \`newman\` Version 4.5.5
> - \`newman-reporter-htmlextra\` Package Version 1.17.1
> \- \`Node\` Version 12.13.0
> - \`OS\` Windows 10
> 
> \*\*Additional Context\*\*
> Add any other context about the problem not mentioned, the more information that can be provided the better. 
> 
> \- Are you using the reporter from the command line or with a script?
> A: Using the reporter from the command line
> 
> \- Are you using the default template or a custom version?
> A: Using the default template
> 
> \- If you are using a custom \`.hbs\` file, please include this on the report.
> A: No
> 
> \- Have you made any local changes to the \`index.js\` file?
> A: No

The reporter can only display the information that it gets from the Newman Summary Object.

---

<div class="post-metadata">

**Author:** ![security-explorer-92](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@security-explorer-92](https://community.postman.com/u/security-explorer-92)\
**Post date:** [February 1, 2024, 8:41pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/5 "2024-02-01T20:41:41Z")

</div>

> [@danny-dainton](#):
>
> The reporter can only display the information that it gets from the Newman Summary Object.

No way, this has been an issue since 2017? Lost all my hope. ☹

---

<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:** [February 1, 2024, 10:48pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/6 "2024-02-01T22:48:06Z")

</div>

The reporter is an open source community project - If there are changes or issues that you can fix, PRs are very welcome. 😂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [March 2, 2024, 10:48pm UTC](https://community.postman.com/t/testscript-requests-appear-as-main-request-in-the-reports/57041/7 "2024-03-02T22:48:28Z")

</div>

Closed on March 2, 2024, 10:48pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
