Pickup specific request based on input from data file

0

I am having list of request under a collection.I want to run a particular request based on input which is being passed via data file.

For Example:

If name of requests will be TC-1,TC-2,TC-3,TC-4…I want to run only TC-2 and TC-3 based on inputs from my data file.I will keep my data file as csv format and will keep my all inputs in row(As mentioned in image]

image
image

That’s not how the collection runner\data files work.

The collection runner will run one iteration for each line in the CSV file.

So in your example, it will always run eight iterations. Passing the test case number in on each iteration.

What you can potentially do is have an array of the requests that each iteration is allowed to run in your data file. For example [“TC-1”, “TC-2”, “TC-8”].

Each line will specifically need to state which requests are allowed to run.

Then in the pre-request script at the folder or collection level, have a check to see if the current request name is in the array. If its not in the array, use the skip request feature to skip that request.

Optimize Your API Testing Workflow with Postman’s Skip Request Feature | Postman Blog

@michaelderekjones Awesome and wonderful. Thanks for your help…