I have created a batch file containing different collections for different sets of API’s (this is required for the business) which are executed one by one through newman and which also generates a report for each of them separately
Now the issues is , there could be 50 collection which will generate 50 reports and would be time consuming to go through each report and check all passed or not. And from cli report in the cmd window it’s also not feasible to notice which one failed.
Thus what I am looking for is that , if there is a fail in any of the API in a particular collection then it would named generated report with “fail” mark or something like that so that I can easily identify which are the ones got failed. Or if you have any other better alternative to this issue , please suggest…
All of your help is required as I got stuck due to this.
I think the --bail flag might help you detect a failed collection run in your batch file and then rename the file accordingly. I think Newman should only exit with code = 0 when all tests pass, and a non-zero value with failures.
See the Newman docs and search for the --bail setting. Maybe also have a look through the Newman docs at GitHub and npm
Alternatively, you could also use the json reporter (or another file format you like that has a newman reporter) and then run something like grep to find if there were any failures recorded in that file, and when required rename your reports.
Hi @VincentD123 , thanks for your help, I have tried with bail but that skipped the report if it fails. Although as you have mentioned that it has some other settings, let me check and try. thanks once again for your response
As this is a response to an issue that was opened 5 years ago and a lot of things have changed in the platform within that time - Could you create a new topic which contains the full contextual details of your particular use case, please?