how can i test if field “gender” is 1 or 2 Please?
“naturalPerson”: {
“fullName”: “Teste with Luis”,
“nickName”: “Pacheco”,
“gender”: 2,
“pronoun”: 2,
how can i test if field “gender” is 1 or 2 Please?
“naturalPerson”: {
“fullName”: “Teste with Luis”,
“nickName”: “Pacheco”,
“gender”: 2,
“pronoun”: 2,
Assuming your response looks like this:
{
"naturalPerson": {
"fullName": "Teste with Luis",
"nickName": "Pacheco",
"gender": 2,
"pronoun": 2
}
}
Then to check the ‘value is 1 or 2’ you could use the following
const response = pm.response.json();
pm.test("Check value is either 1 or 2", function () {
pm.expect(response.naturalPerson.gender).to.be.oneOf([1, 2]);
});
Your are the best!!.. Thank you x 1000…
Be happy