Hi, I have a single POST request to which I pass 8 different sets of data while running collection using csv or json file.
ex:
{
“Id” : "{{ID}},
“name”: {{name}},
“email” : {{email}},
“phn” : {{phn}}
}
all fields are mandatory and i want to check mandatory error on leaving each field empty at each iteration.
I get Different response for each iteration and I want to validate my response message.
I need to validate a single line which looks like
var messageDetail = pm.response.json().MessageDetail
pm.test(“message”, function(){
pm.expect(messageDetail).to.equal.(“output which is different on each iteration”);
});
Hi vdespa, thanks for your response,
But i am getting error on line
console.log(pm.iterationData.get(“expected_result”));
thier by i cannot add test like
pm.test(“MessageDetail”, function(){
pm.expect(messageDetail).to.equal(pm.iterationData.get(“expected_result”));
});
Error in dev tools :
Invalid or unexpected token