Saturday 16 July 2022

Append date and time to newman html extra report

Below command on node.js command line generates html report with date and time.  

newman run TestCollection.postman_collection.json  -e TestEnvironment.postman_environment.json -r htmlextra --reporter-htmlextra-export D:\posman\newman\TestCollectionReport_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%.html

Or

D:\postman>newman run "SmokeTests.postman_collection.json" --folder SmokeTestAPI -e "QALabEnv.postman_environment.json" -r htmlextra --reporter-htmlextra-export "C:\postman\newman\SmokeTestsAPIReport_%date:/=-%_%time::=-%.html" 


Example:
D:/postman/newman/TestCollectionReport_20221507_1720.html


Tap on the below image for best view



No comments:

Post a Comment