I am learning to write Test cases in postman and my Request body looks like this
{
"PhoneNumbers": [
"string"
],
"EmailAddresses": [
"string"
],
"FirstName": "string",
"LastName": "string",
}
And my test case is like this
pm.test("Phone number matches", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.PhoneNumbers).to.eql("string");
});
My Response body looks like
{ "PersonId": 1,
"AdressId": 2,
"NationalID number": 123456
}
So basically this API generates an ID for the person given in the request. But my test case is failing with the error "ReferenceError: string is not defined"
I kind of know that it is under an array so I cannot compare like this so Anyone have any suggestion how can I correct this. please advice. Thanks in advance.