-1

Hi Team I have response Json whose body is as below

{
"host": "telemarket-backend.val.io",
"ssl-client-verify": "NONE",
"x-request-id": "916633224df75cb3cd728631879612181761",
}

when I am writing test in Postman for the above body as described

const responseJson=pm.response.json();
pm.test("Validate the SSL ",function(){
pm.expect(responseJson.ssl-client-verify).to.eql("None");
});

Above one is not working as expected while the below one is working as expected

pm.test("Validate the host  ",function(){
pm.expect(responseJson.host).to.eql("telemarket-backend.val.io");
});

can you tell me the reason why is it not working and the fix resolution which can work on postman

jitendra gupta
  • 47
  • 2
  • 11

1 Answers1

-1

Correct solution that I have found out is pm.expect(responseJson[ssl-client-verify]).to.eql("NONE");

jitendra gupta
  • 47
  • 2
  • 11
  • The thing is, this was all present in the comment that I gave you. It seems you didn't even read it? Moreover, you're not _explaining_ anything; you're just throwing the "right" answer at us, without explanation. That's not useful. – matt Mar 10 '22 at 18:20