I’m not sure exactly how your tests are structured - do you have separate folders for Create, Edit, Search and Delete?
Regardless, it may be useful to know that the request info object allows you to determine which iteration (i.e. which CSV row) is currently being tested.
For example, here is a dummy test which would only run on the 10th-15th rows of your CSV file:
if(pm.info.iteration >= 10 && pm.info.iteration <= 15) {
pm.test("Hello world", function () {
console.log("Running test on iteration " + pm.info.iteration)
pm.expect(1).to.equal(1)
});
}
(Depending on how your tests are structured, you may choose to put this “if” block somewhere different; e.g. you might wrap it around your entire set of tests, or you might set the iteration count check into a boolean so that you can repeatedly reference it with less code)
However, this relies on your source data structure never changing, and might be difficult to maintain. If you have control over your CSV file, it might be beneficial to add an extra column called (for example) TestsToRun and set the value to whichever tests you want to run, for example:
Account,Name,TestsToRun
123,John,CreateEditSearchDelete
199,Joe,CreateEditSearchDelete
250,Jim,CreateSearchDelete
999,Jack,CreateSearchDelete
Then instead of checking the iteration number, you can just check the value of TestsToRun for this iteration to determine whether to run the test:
if(pm.iterationData.get("TestsToRun").includes("Edit")) {
pm.test("Hello world", function () {
console.log("Running test on iteration " + pm.info.iteration)
pm.expect(1).to.equal(1)
});
}
In this way it would be easier to review your CSV in the future, remember which tests are running for each iteration, and make changes to which test cases are running without having to make further script modifications.