Hello
I am trying to put an assertion for a specific field value in the array , e.g. “message” should contain the value as “Invalid property value” in the below response
“errors”: [
{
“error”: 900,
“message”: “Invalid property value”,
} ]}
postman assertion script is :
let jsonData = pm.response.json()
pm.test(‘The errors
contains message’, () => {
_.each(jsonData.Fee, (item) => {
pm.expect(item.message).to.include("Invalid property value")
})})
but what I observed is this script is passed for following response also
“message”: “Successful”,
“decision”: “PERMIT”,