The New Skip Request Feature

In the fast-paced world of API development and testing, efficiency and flexibility are key. Developers need tools that facilitate the testing and automation of their APIs and allow them to optimize their workflows. With this in mind, we are super excited to introduce a feature that’s been heavily requested by our community: pm.execution.skipRequest() . This function empowers users to skip or stop requests from being sent, all within the pre-request scripts stage of your API testing, providing unparalleled control over your testing and conditional workflows. The function takes effect in the Postman API client, Collection Runner, and Postman Flows.

Here’s an awesome short video, running through the new functionality:

1 Like

Hello!
Very nice to see this feature!
Just one small disappointment: there is no specific message in the execution summary, only this “No tests found” which is a bit misleading. I hoped there would be a string parameter to the pm.execution.skipRequest() that would be displayed there.
Thank you anyway!

Hey @bmarchandise :wave:,

Welcome to the Postman Community! :postman:

Technically, that would be true though right? If you have tests after the .skipRequest() function, those wouldn’t have been found or run.

It wouldn’t be limited to only that function - you would get the same result if you did something like this:

This would also not execute the code after it:

With the new function, there would be a difference, being that there wouldn’t be a status code for the request and it would show No response on the right side.


Having said that, we appreciate the feedback here and it could be made more visible, that the request has been explicitly skipped.

Could I ask that you raise this as a feature request on our public tracker so that they team can take a look. :pray:

Hey!

I’m using the new .skipRequest() feature on a number of requests in a collection I’m running. When running the collection through manual runs in postman, it runs perfectly!

The only small comment is that I’d like the messages of the skipped requests to be clearer/just not appear at all. (In my personal case, it would be a lot cleaner when those requests just don’t show up at all, since I’m skipping quite a lot of requests each run. That would be just like when they have been skipped using .setNextRequest().)

When using newman, I’m getting the following error message:

Is there any idea when newman will be able to parse this new function? (currently running newman 6.0.0)

Kind regards,
Michiel

+1 on this. It works via the UI but I get the same error when runnning via the postman CLI.

Hey @michiel-circumflex / @telecoms-geoscient19

Those (Postman CLI and Newman) haven’t been updated yet so the skipRequest function, currently will not work outside of the app.

This is being tracked internally and I will update here once I know more information. :pray:

Just to follow up here:

The support for .skipRequest() was added to the Postman CLI in version 1.6.0 and there is an open PR to add this to Newman.

1 Like

Hoping that Newman will get an update.

This topic was automatically closed after 30 days. New replies are no longer allowed.