AssertionError: expected undefined to deeply equal 'fiction'

pm.test(“API working”, function(){

pm.response.to.have.status("OK")

});

pm.test(“Filtered book details:-”, function(){

var jsonData = pm.response.json();

pm.expect(jsonData.type).to.eql("fiction");

})

In Console, Response body is like

[{“id”:1,“name”:“The Russian”,“type”:“fiction”,“available”:true},{“id”:3,“name”:“The Vanishing Half”,“type”:“fiction”,“available”:true},{“id”:4,“name”:“The Midnight Library”,“type”:“fiction”,“available”:true},{“id”:6,“name”:“Viscount Who Loved Me”,“type”:“fiction”,“available”:true}]

Hey @shekhar87! Welcome to the community :partying_face:

Seems like there is some issue with accessing the response,

var jsonData = pm.response.json();

Maybe try logging the response and check, also if you could share the response you are getting then it’ll help the community help you faster.