'Postman Validate key-value pair corresponding to another key-value pair
The Response body is like:
[
[
{
"id": "1",
"status": false
},
{
"id": "1",
"status": false
}
],
[
{
"id": "2",
"status": true
}
]
]
I have to validate if id =1, status should be false, Test gets passed
I tried this:
var jsonData = pm.response.json();
for(var i=0; i<jsonData.length; i++)
{
if (jsonData[i][i].Id==="1")
{
if (jsonData[i][i].status=== false)
{
pm.test("Holiday Update is Sucssesful");
}
} } But this one is getting invalid token error
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
