Asserting the response is false

I have a request where the body of the response contains only a boolean.
How do i create an assertion that it is false?

I tried pm.test(“Response should be false”,function(){‘false’)

Im getting the error AssertionError: expected { Object (id, _details, …) } to deeply equal ‘false’

Hi :eyes: false is a bool , so needs to be compared with one too . You can use any of the below codes :grin:


1 Like

Hi @hannahbroch

It really makes a difference if your response is JSON or simply text.

If you are getting something like:

    "created": false

you should parse it with pm.response.json() first.

If this is not JSON, try something like:

pm.test("Should contain false", () => {

thanks! this worked great