Using pm.execution.setNextRequest to skip to the next folder instead of a request

While I’m on here thought I’d ask this question, I don’t think it’s possible.

Is it possible to skip to the next folder name within a collection rather than the next request name using pm.execution.setnextrequest? Or is there another function that we could use?

Hey @annaboek :waving_hand:

There isn’t a skipToFolder function but passing in the name/id of the first request in the folder, would do the same thing.

Can you expand a little bit on your workflow to help us understand what it is you’re trying to do?

Hi @danny-dainton nice to hear from you again. What I was thinking of was trying to avoid those situations where someone may move a request or insert new requests above the one you reference. We usually put our tests in folder in a collection so wondered about just hopping to the next test scenario folder rather than request.

You could adopt a process that involves having a main Collection that no one but yourself can make changes too and then have a forked version where changes can be made that won’t impact you main Collection.

If changes are needed you can create a pull request and review those before merging them into the main Collection.

The request is going to pick up any tests at that Folder level, the Folder itself wouldn’t “run” as such.

You could also use the Postman API in an async request to grab the details of your first request in the folder, that could be anything if someone has changed something, and feed that into the setNextRequest() function?