If statement 如何通过脚本在POSTMAN Collection runner中设置失败

If statement 如何通过脚本在POSTMAN Collection runner中设置失败,if-statement,console,postman,postman-collection-runner,If Statement,Console,Postman,Postman Collection Runner,如何通过脚本设置“失败”?我有一个IF,在这个IF中,我想检查X与Y的比较。如果不是,我想得到一个“FAILED”。目前,我在控制台中得到一个“失败”,但测试是“通过”。我已经搜索了其他网站,但没有找到任何关于这方面的信息。希望你明白我的意思 if(pm.iterationData.get("ProfileSeries") == response.ProfileSeries){ console.log("expProfileSeries " + pm.iterationData.g

如何通过脚本设置“失败”?我有一个IF,在这个IF中,我想检查X与Y的比较。如果不是,我想得到一个“FAILED”。目前,我在控制台中得到一个“失败”,但测试是“通过”。我已经搜索了其他网站,但没有找到任何关于这方面的信息。希望你明白我的意思

   if(pm.iterationData.get("ProfileSeries") == response.ProfileSeries){
    console.log("expProfileSeries " + pm.iterationData.get("ProfileSeries") + " = "+ response.ProfileSeries);
    }
    else{
         console.log("FAILED");
}

使用相关的
pm.expect添加
pm.test

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

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

});

什么是
response.ProfileSeries
?你能提供一个回复主体的例子吗。