Hi ,
I want to verify whether either 0th or 1st value in below is equal to âAFâ
âvalidationResultErrorsâ: ,
âerrorKeysâ: ,
âdataâ: [
{
âidâ: âcd367fba-f943-e911-a817-005056a23fb6â,
âisoNumericâ: â004â,
ânameâ: âAfghanistanâ,
âisoA2â: âAFâ
},
{
âidâ: âcf367fba-f943-e911-a817-005056a23fb6â,
âisoNumericâ: â008â,
ânameâ: âAlbaniaâ,
âisoA2â: âALâ
},
âŚetc.
I used below code.
var i = 0
var jsonArray = pm.response.json();
pm.test(âVerify Received relevant Country Listââ, function () {
for(i; i<jsonArray.data[i].length;i++){
pm.expect(jsonArray.data[i].isoA2).is.to.equal(âAFâ)
}
});
This is working and Pass. But i just changed the is.to.equal(âHelloâ) and still it gets Pass.
So it seems my code is incorrect.
Could u please help me on this?