Skip Request During Iteration

Hey all,

I am fairly new to Postman test automation and I am trying to figure out the best way to organize a collection by a service and iterate over all of the operations for each endpoint in said service.

I have gotten the iteration working using a JSON file, but I am curious what the best practice is for trying to accomplish the task I have outlined above.

Currently, I have my iterations feeding the data into Postman to configure the requests, the thing is some of the configurations are not valid for all requests in the collection due to the differing endpoints. This leads to requests being fired erroneously for certain configurations and tests failing (which is expected given the improper config).

Is there a way I can check the endpoint and have a conditional that basically says "if it iteration contains this endpoint then only iterate over that request. Or is there a better way to accomplish what I am trying to do altogether? I canโ€™t think of another solution that keeps all of my endpoints for a service and their operations in one collection.

Note I am not doing any sort of process flow or anything like that, but am rather blasting the endpoints with all sorts of different permutations of requests (both positive and negative scenarios) and asserting the data is being returned as expected.

Thank you!

Hey @nickpeterson92 :wave:

If I get it correctly, you would like to create conditions based on the URL value. If so, you can get the value using pm.request.url in the Pre-request script and possibly create a conditional workflow in there.
You can read more about workflows in our Learning Center: https://learning.postman.com/docs/postman/collection-runs/building-workflows/

Let us know if that helps!