0

How can I set a "FAILED" via script? I have a IF and in this if I want to check is X compare to Y. If not I want to get an "FAILED". For now I get an "FAILED" in my console but the test is "PASS". I already searched other sites but found nothing about this. Hope u now what I mean.

   if(pm.iterationData.get("ProfileSeries") == response.ProfileSeries){
    console.log("expProfileSeries " + pm.iterationData.get("ProfileSeries") + " = "+ response.ProfileSeries);
    }
    else{
         console.log("FAILED");
}
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
KaiV
  • 1

1 Answers1

0

Add pm.test with relevant pm.expect:

pm.test('ProfileSeries should be equal', function () {

pm.expect(pm.iterationData.get("ProfileSeries")).to.equal(response.ProfileSeries);

});
Ori Marko
  • 56,308
  • 23
  • 131
  • 233