It would be of a great help if you can help me with the below query.
When you want to have JSON assertion we should specify the index of the array in the JSON Xpath. For Example.
data[
{ "id": 2,
"name": "An ice sculpture",
"price": 12.50,
"tags": ["cold", "ice"],
"dimensions": {
"length": 7.0,
"width": 12.0 },
"warehouseLocation": {
"latitude": -78.75
}
}
]
then we will give the xpath as "$.data[0].name" which will return the value as " An ice sculpture". Now i have an requirement where in the json response is below.
data[
{ "id": 2,
"name": "An ice sculpture",
"price": 12.50,
"tags": ["cold", "ice"],
"dimensions": {
"length": 7.0,
"width": 12.0 },
"warehouseLocation": {
"latitude": -78.75
}
}
{ "id": 3,
"name": "An ice sculpture1",
"price": 12.50,
"tags": ["cold", "ice"],
"dimensions": {
"length": 7.0,
"width": 12.0 },
"warehouseLocation": {
"latitude": -78.75
}
}
]
now i want both of these values to be verified, how do we do this in DevTest tool ?