check the response JSON key value
Tests that the value of
code
key is equal to
400
pm.test("status code is equal to invalid HTTP request", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.status.code).to.eql(400);
});
The response JSON
{
    "status": {
        "code": 400,
        "text": "Mobile Number is required"
    }
}
by Valeri Tandilashvili
4 years ago
Postman
postman tests
0
Pro tip: use ```triple backticks around text``` to write in code fences