[201,202] response.code problem working properly and now failing | Community
Skip to main content

[201,202] response.code problem working properly and now failing

  • March 11, 2022
  • 0 replies
  • 0 views

Hi,

I'm creating tickets using API by loading a csv file using postman. This file is automatically generated on a daily basis and hasn't suffered any modifications. The problem is that since a couple of days the POST API began returning a test error.

Test code:

pm.test("Successful POST request", function () {
   pm.expect(pm.response.code).to.be.oneOf([201,202]);
});
Error:
Successful POST request | AssertionError: expected 422 to be one of [ 201, 202 ]
Any idea of what's happening since everything is still the same and all of a sudden I began receiving this error?