Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : Can we set custom exit code in Postman requests which can be returned by newman #2967

Open
devsharma327 opened this issue May 10, 2022 · 1 comment

Comments

@devsharma327
Copy link

Question : I need to return a custom exit code from newman in my shell script which can be set from Postman request based on some specific status code ?
In my requirement, while running a test collection through newman from shell script, I need to know by which status code does the test collection fails. One method I can think of is to manually set the exit code in test collection from postman, so that in shell script by using the exit code I can identify the status code by which it failed.
Can this be done from postman?

@shamasis
Copy link
Member

I have one idea - what if you set your info in a variable, configure Newman to export variables, read that (maybe simply process unique string presence in the exported file), then delete the exported file and use the result as exit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants