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.
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
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”
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
The HTML report was created, it says that in the output before the error.
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.
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
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.