-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Collection Runner and Newman: a request that got no response does not abort the collection, no way to do so programmatically #1898
Comments
I attempted this to abort the collection promptly if the service is not responding:
...but it doesn't work, the collection always terminates after the first request. Apparently only the first call to Can we please get some clear documentation of how
Note: answering those questions here in issue comment discussion is not documentation. |
Moved it to newman and would make part of release that tackles better execution control.
|
I was able to break the flow using below code. Write it in the test script of first api, if api response returns success = false, it would break the flow. |
Is this issue still open? I have a request very early on in my collection that checks to make sure a dependancy is up. My test looks like this: `// Check for success // Parse response pm.test("Maintenance mode = false", function () { if (resp.inMaintenanceMode === true) When I run via Postman app - it stops at that point if the flag is true. |
Actually no, this does seem to be working as expected in Newman when i tried again today; it must have been something I did wrong. |
I have a fairly large test collection that I'm working on right now. This morning I fired it off in Newman with HTML output against my dev environment and... it just sat there.
Disabling HTML output showed pretty clearly that the webservice wasn't responding - oops, forgot to start it up. D'oh! :(
So I've been digging around in the Postman docs to see how to catch this and do
postman.setNextRequest(null);
to abort the collection, and... there's no programmatic way to capture "no response" - and getting no response to a request (obviously) does not automatically abort the collection run.This isn't so bad in Collection Runner because that's interactive and the user can abort it easily enough, but Newman is probably running the tests unattended.
To Reproduce
ECONNREFUSED
)Expected behavior
Either:
or
Newman does have the
-bail failure
option, but that's too broad - I do want to run multiple tests and verify their results and see all the failed test conditions; bailing on the first test failure isn't desirable.Perhaps
-bail
needs arequest_failure
option too?Perhaps (also?) there needs to be an option to run a javascript snippet if the request fails. This would be more flexible, but would be a more-intrusive change to both Newman and Postman...
App information:
Newman 4.3.1 on Windows 10
The text was updated successfully, but these errors were encountered: