How to assert on a property

Below is the json response, I want to make sure “status” property is present. I don’t want to test for the value of the status i.e. 422

I tried with the following, but no luck.



"errors": [


        "message": "UnprocessableEntityError",

        "path": [



        "extensions": {

            "code": "UNPROCESSABLE_ENTITY_ERROR",

            "name": "Unprocessable Entity",

            "data": {

                "errorCode": "",

                "status": 422,

                "friendlyMessage": "Could not register at this time.  Please try again later"





"data": null


I was able to assert using the below code, but would like to know what is the difference between the 2?

//This one works“data.loginPowerPassCard.accessToken”);

//This one doesnt
pm.expect(responseInJson)“data.loginPowerPassCard.accessToken”);'errors[0]'); probably does not work because that does not count as a property. You can just paste a path to a property.'errors'); would work, since errors is a property of the root object.

.to.have.jsonBody() may work, since you can provide a parameter with a path. So this will test the existence of the path within the response body.