How do i skip one request from collection

Lets say i have 5 requests in collection and i wanted to skip 2 requests while running.How do i do that?

You could use postman. setNextRequest('request_name') in the last request you want to run, to jump over the ones you want to skip.

https://learning.getpostman.com/docs/postman/collection_runs/building_workflows/

As Danny said, use postman.setNextRequest("request_name") to skip or jump to a certain request.

Bear in mind, if you have multiple requests with the same name Postman will jump to the last match.

Also be mindful of using this command during a collection run and if you have any requests with the same name in sub-folders etc.

1 Like

I have to have request β€˜A’ as 1st request, which is different compare to rest of the request. I need to skip the 1st request β€˜A’ from collection level test script. Otherwise it will fail the and not run the remaining test.

  1. PUT request (set some thing for givin user, and needs to be skip from collection level Test script)
    2,3,4 … remaining are GET request (collection level Test script validate the json response).

Rule is 1st PUT request has to be send 1st.

Hey @binitnyt,

I don’t believe you can skip the first request. A workaround to that is adding a dummy request ahead of what your first request is now. It can point to a URL like https://postman-echo.com/get which will just echo the request in the response. In the pre-request script for the dummy request, you can set postman.setNextRequest("<next-request-name>").

Best,

Kevin