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");
}
4

1 回答 1

0

添加pm.test相关pm.expect

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

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

});
于 2018-08-09T07:13:24.470 回答