Collection Runner Assertion Errors

Hi Team
I just started learning Postman and practising the same with https://dummy.restapiexample.com/ site.
I want to create (POST) multiple records at a time.
for that I have used .csv file
API

I have given below data as input in Body
{
“name”:“{{name}}”,

    "salary":"{{salary}}",

    "age":"{{age}}"
}

and added few validation points in tests tab
tests[“checking the response code”] = responseCode.code == 200;

tests[“checking the status without position”] = responseBody.has(“success”);

I given 4 iterations as per the above .csv file
when I run only first iteration request gets failed( AssertionError: expected false to be truthy) and getting response code 429
remaining runs successfully

I am really worried about this on first day only I am facing too many issues
Please help me with this

When using the runner with a CSV file, you don’t have to set the iterations, it will run once for each line in the CSV file.

You do need to set iterations if you are using a JSON file.

That is also using the old way of writing a test (although I don’t think that is what is causing your issue).

pm.test("Status code is 200", () => {
  pm.response.to.have.status(200);
});

If you have just started learning Postman, I recommend using the Learning Centre first.

Postman Galaxy Training | Postman API Network

Run through the “APIs 101 Training”, then the “Testing and Automation Training” course.

Thanks Mdjones for your help

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