--script :
pm.test("Your test name", function () { var jsonData = pm.response.json(); pm.expect(jsonData[0].id).to.eql(1); });
--Error - Your test name | TypeError: Cannot read property 'id' of undefined.
Body of the API : { "page": 1, "per_page": 6, "total": 12, "total_pages": 2, "data": [ { "id": 1, "email": "[email protected]", "first_name": "George", "last_name": "Bluth", "avatar": "https://reqres.in/img/faces/1-image.jpg" },
2.1m questions
2.1m answers
60 comments
57.0k users