lundi 5 juin 2017

How to extract the data from JSON file to write test case

How to extract the required parent/child node value from JSON output in postman.

I need to extract model.ConfirmPassword from the below JSON file.

{
  "Message": "The request is invalid.",
  "ModelState": {
  "model.ConfirmPassword": [
  "The password and confirmation password do not match."
  ]
}

What is the property to be passed in order to get that. jsonData.value is not working as I mentioned below.

var jsonData = JSON.parse(responseBody);
tests["Your test name"] = jsonData.value;

Image

Aucun commentaire:

Enregistrer un commentaire