mercredi 25 janvier 2017

POSTMAN: Get Generated Request in test to compare to Response

I am using some of the auto generated parameters in my request body in a postman request(i.e: ).

I would like in my test to retrieve the request that was sent to the server to compare what this variable value was, and what the response parroted back to me me in my request.

for example, my request's body looks like this:

{
 "Description": "testing this "
}

and I would in the tests be able to do:

var request = JSON.parse(requestBody);
var response = JSON.parse(responseBody);
test[description should match] = request.Description === response.Description;

is this doable?

Aucun commentaire:

Enregistrer un commentaire