Skip rows from csv data file from test run

The only option I can think of here is to have your test data as a single cell in your CSV.

Store it as a JSON array with quotes (stringified).

You can then use a pre-request script to retrieve the data and store it as a collection variable.

Remember to stringify when storing JSON, and JSON.parse when retrieving.

Still in the pre-request scripts. You will then retrieve the collection variable.

You will the use a JavaScript function called array.shift() which can read the JSON array, retrieve the first element into a new variable, and then delete it from the array.

You can then use new variable for the current request, and you would re-save the current array over the top of the current collection variable (which will now have one less record).

It’s here you can add some extra conditions to check if your “include” element = false. If it does, you just use the array.shift() method again until you get an entry that isn’t false.

In the tests tab, after the request has run. You can retrieve the array again (remember to JSON.parse). Do a length comparison, and then keep running the same request using setNextRequest() until the length == 0. This is how you control the loop.

The following article has an example of this method.

Simulating 100 users using Pre-Request and Tests - :person_raising_hand: Help - Postman Community