API Testing 'A Beginners View': JavaScript - Array.prototype.find() and Array.prototype.findIndex()

jsonData = pm.response.json()

pm.test("Verify value", function () {

    pm.expect(jsonData['data'].find((a) => a['sipaddress'] === "[email protected]")['sipaddress']).to.equal("[email protected]")

});

you can use array.find , it finds the object that has the sipaddress and then explicitly take that value and validate

2 Likes