Postman CSV file positive and negative scenarios

I am trying to test one of the new API calls.
Request got 10 variables and I have created a csv file with 10 columns and Expected result.

Successful scenarios - I had different sets of data in CSV file and Expected column has 201 for success and other validations, I have it in Post response script and this works.

For negative scenarios - I planned to pass incorrect data into the columns and run through it but now my response got different json body and I am not sure how to build that in ‘post- response’ tab for both successful and nit successful scenarios.

Any help is appreciated.

Add a column for the test type with “postitive” or “negative” filled in for each row.

Add an IF statement that checks this field.

If the value is positive, then you run your existing tests.

If the value is negative, then you run your new tests against that response body.

This means you can have postitive and negative tests without having to have individual requests for each scenario.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.