Postman: How to check whether the field is returning null in the Postman automation

后端 未结 10 1026
借酒劲吻你
借酒劲吻你 2020-12-31 05:57

I have tried with \"!== null\", but it is returning PASS even when the field is returning 0 or \"\".

10条回答
  •  执念已碎
    2020-12-31 06:41

    try this one:

    pm.test("your-value is not null", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.your_value).not.eql(null);
    });
    

提交回复
热议问题