Unable to create htmlextra reports using Jenkins in specific folder

I’m trying to create HTML extra reports using Jenkins and want to store them in a specific folder (C:\Users<username>\Documents*_*\NewmanReports).
1)This is where my Newman and HTML extra is installed.


2) This is how I’m writing the Post-build action, which I’m not sure if is correct.

HTML directory to archive
C:\Users<username>\Documents<Project_Name>\NewmanReports
Index page[s]
index.html
Index page title[s] (Optional)
<Project_Name> API TestsReport
Report title
<Project_Name> API TestsReport

  1. This is how I’m writing Build command


    C:\Users\waniijag\AppData\Roaming\npm\newman run C:\Users\username\Documents\<Project_Name>\API_TestCases_collection\LandlordSales_B2L_L2Q.postman_collection.json --reporter-htmlextra-export “C:\Users\waniijag\Documents\AIMO_PARK\NewmanReports\report.html”

  2. This is where Jenkins is stored

  3. This is the response I’m getting at the console output


    Please let me know what further action should I take or where I’m going wrong.

Hey @jagrutiwani0

It’s difficult to see the command you’re using but I can’t actually see you specifically using the reporter.

I can see that you have the --reporter-htmlextra-export flag in the command but not -r htmlextra

If the reporter was enabled, you would have seen a different output in the console and not the default CLI reporter output.

Hi @danny-dainton ,

I’m getting the console output as follows if I’m using -r htmlextra as shown in the below image
Build code
C:\Users\waniijag\AppData\Roaming\npm\newman run C:\Users\waniijag\Documents\AIMO_PARK\API_TestCases_collection\LandlordSales_B2L_L2Q.postman_collection.json -r htmlextra

Started by user Jagruti Wani Running as SYSTEM Building in workspace C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\AimoPark_API_Automation [AimoPark_API_Automation] $ cmd /c call C:\WINDOWS\TEMP\jenkins5081482399976235502.bat C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\AimoPark_API_Automation>C:\Users\waniijag\AppData\Roaming\npm\newman run C:\Users\waniijag\Documents\AIMO_PARK\API_TestCases_collection\LandlordSales_B2L_L2Q.postman_collection.json -r htmlextra Using htmlextra version 1.20.4 Created the htmlextra report. [htmlpublisher] Archiving HTML reports… [htmlpublisher] Archiving at PROJECT level C:\Users\waniijag\Documents\AIMO_PARK\NewmanReports to C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\jobs\AimoPark_API_Automation\htmlreports\AIMO_20PARK_20API_20TestsReport ERROR: Directory ‘C:\Users\waniijag\Documents\AIMO_PARK\NewmanReports’ exists but failed copying to ‘C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\jobs\AimoPark_API_Automation\htmlreports\AIMO_20PARK_20API_20TestsReport’. ERROR: This is especially strange since your build otherwise succeeded. Build step ‘Publish HTML reports’ changed build result to FAILURE Finished: FAILURE

Do I also need to use –reporter- htmlextra along with -r htmlextra ? The report is not getting generated in the mentioned folder of Post Build action

The HTML report was created, it says that in the output before the error. :joy:

The error mentions not being able to copy the file into that directory, that’s more of an issue on your environment side and not to do with the htmlextra reporter or newman.

1 Like

Hi @danny-dainton ,

Thanks! The environment issue is also solved.

1 Like

Hi @danny-dainton ,

Sorry for my silly questions, how do I store the reports for different runs in the same folder? I think I will have to make use of timestamp in the script. Can you guide me on this?

I’m using the below as the build command:

C:\Users\waniijag\AppData\Roaming\npm\newman run C:\Users\username\Documents\<Project_Name>\API_TestCases_collection\LandlordSales_B2L_L2Q.postman_collection.json -r htmlextra --reporter-htmlextra-export C:\Users\username\Documents<Project_Name>\NewmanReports\report.html

Hey @jagrutiwani0

You could use something like I’ve suggested in this issue to add a timestamp to the file name?

As you’re using Jenkins, I’m guessing that you could use a Jenkins Environment Variable in the export name to add a level of uniqueness but I’m not too familiar with all things Jenkins so that’s just a suggestion. :grinning_face_with_smiling_eyes:

1 Like

Hey @danny-dainton ,

This worked. Thank you so much :slight_smile: