Tuesday, 26 November 2019

How to get the status of test(i.e. pass or fail or error) in Postman?

Here is my test case in postman

pm.test("verify the JSON object keys for machines - ", function() {
    if (Object.keys(data).length === 0) {
        pm.expect(Object.keys(data).length).to.eq(0);
    }
}

Now if status of this test is PASS then I don't want to execute next test case but if status is FAIL then next test case should get executed Next test case is -

pm.test("verify the JSON object keys for machines- ", function() {
        pm.expect(data[1]).to.have.property('timeStamp');
    }


from How to get the status of test(i.e. pass or fail or error) in Postman?

No comments:

Post a Comment