AH, a very simple question, but I can't seem to find the answer anywhere. This is my first set of postman tests. I have a request that returns this JSON response:
{
"requestId": "3dd0#170fa14fb64",
"result": [
{
"id": 52508,
"status": "deleted"
},
{
"id": 52507,
"status": "deleted"
}
],
"success": true
I want to write a test that verifies that both of the status objects within the result array will have the value "deleted" but I don't know the correct syntax to do so...so far I have this
pm.test("Test users deleted successfully", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.result[0].status).to.eql("deleted");
});
This works great for verifying the first status object, but how do I target the second one in that array?