I have been looking for a Postman/Newman based solution to automate the API testing process and report the results to Azure DevOps Test Plans/TestSuites for a long time. Since I couldn’t find anything specific online I built it myself and made it available to the open-source community.
Link to Linkedin article: Automated Testing with Postman and Azure DevOps: JUnit2ADO
Hey @smedas
Welcome to the Postman Community!
This looks a cool project - Have you experimented using the Postman CLI with the junit reporter?
You can run that directly using the Collection ID which will show the latest version of the Collection, rather than exporting a snapshot of the Collection each time.
Hey @danny-dainton !
Thanks for you reply!
I haven’t tried with PostmanCLI, but I have used newman with the JUnit reporter (which should be the equivalent), and that’s exactly where I started.
That is: the powershell script I wrote takes the XML file (JUnit) as input and maps the tests/asserts to the Azure DevOps ones.
Essentially what the script I wrote does is to connect the results written in JUnit to the Test Cases in the ADO Test Suites.
It’s the older equivalent - It would be great to see an updated flow using the Postman CLI and the JUnit reporter, you should be able to do the same with that output.
As I mentioned, the added bonus being that you wouldn’t need to manually export a Collection file from the UI each time.
Oh yes, now I understand your suggestion.
Yes, you are right, avoiding exporting the collection every time it is modified is a great advantage.
I had originally excluded the postmanCLI and chosen to use newman because of the monthly call limit (About resource usage | Postman Docs) that is possible in the Free license.
You’d get 1000 calls a month on the free plan but you can of course still use it in the same way that are with Newman and the static Collection file as a fall back option.
I would just be interesting to see if it’s possible to do a swap out of Newman for the Postman CLI in your tool to open it us to more use cases.
that’s a great suggestion… I’ll add this change asap.
Thanks!
As @danny-dainton mentioned.
I find using Postman a much better workflow than having to export your collection each time you make a change.
Also when I need to debug a test, I find postman CLI much better as you can enable verbose mode (--verbose
) to see all request and response bodies easily in the console.
Good to know! Thanks @cruxto
Hi @danny-dainton I just edited the article to include Postman CLI in the automation. Thanks for the suggestion!
Let me know if you have any other suggestions!