check that the response JSON text is equal to the specified text
Tests that the response JSON is equal to the specified text
pm.test("Body is correct", function () {
    pm.response.to.have.body('{"status":{"code":400,"text":"Mobile Number is required"}}');
});
The response JSON
{
    "status": {
        "code": 400,
        "text": "Mobile Number is required"
    }
}
The test returns
true
because the text passed to the test is the same as the response JSON
by Valeri Tandilashvili
4 years ago
Postman
postman tests
1
Pro tip: use ```triple backticks around text``` to write in code fences