We are using postman(6.6.1) newman team license. We have a Jenkins job up and running to execute collections using newman for our services testing.
I am looking for a way to publish simple services status like (200 OK) in a graphical form into a webpage. If I execute my collection (with set of GET /POST calls to ping the server) it should generate a page. This status page should be accessible by our team.
Options explored:
Tried generating a HTML report. It is generating the report in the same directory where newman is executed. How to publish just the green and red status of the integration services status in a web page.
With the above approach one has to go to jenkins server to access the results report. I do not want details like response or headers. We would like to show the service name and ping status in a web page. It should show just red or green some thing like this.
I also came across data dog integration. If I integrate postman with datadog can I accomplish the above requirement?
Is there a slack channel to ask questions about newman/postman? Pl share the name of the slack channel and how to get access to it.
I continued this conversation in a private message but I wanted to add part/general gist of the messages here too for other people…
"I was messing for a few minutes and created this template, based on an example collection that I run locally when testing. The Status column would be a green box and a tick if the status code is 200, or red box and a cross for anything else.
This is the command that allows you to run Collections via Newman. The most basic command would be:
newman run {your collection filename}.json
This would run your collection and output the details of the run on the CLI, this is the default reporter. Although this is using a static exported collection file, you can also use a URL link to the collection file. This can be via a public shared link created within the app or a link to the collection via the Postman API.
The command that I used is using the -e flag to bring in an environment file, which would contain certain variables being referenced in the collection or act as a store for values being set during the run.
This part of the command is using the -r flag (shorthand for --reporters) to tell Newman to use the htmlextra reporter.
The --reporter-htmlextra-export is setting a file path location for the final report to be saved. If this is not used, the final output will be placed into the /newman directory.
Finally, the --reporter-htmlextra-template flag is telling the htmlextra reporter to use a custom template for this run, if this flag was not included in the command, the default template would be used instead.
More information about these flags and the other flags for Newman and the htmlextra reporter can be found here:
Thank you so much @danny-d. I got it and well explained answer. I appreciate your help.
I can run this command from CLI and getting expected output with reports, but when I use the same command on Jenkins to run collection and generate reports, It is not working. I am curious, how it could be possible that same command is not working for Jenkins? How can I generate reports on Jenkins using postman collection?
Also, Jenkins log shows that build, create time and result time is same meaning it doesn’t take even 10 Sec to run collection. Looking for suggestions and understanding.
The data is going to live in lots of different parts of executions - it’s not really a case of getting it in a simpe way because it all depends on the structure the Newman summary object.
I would try to understand the references to each part before trying to add it all to a template.
I wrote this a while back:
It contains a simple version of what Newman returns so hopefully that will allow you to understand it a bit more.