How to run JSON Test Data in Postman?

2019-08-17 18:48发布

问题:

I can run CSV Test Data provided in the below link. But not able to run Json Test Data.

https://learning.getpostman.com/docs/postman/collection_runs/running_multiple_iterations/

Endpoint: https://postman-echo.com/get?city={{City}}&ramen={{Ramen}}

Json Test Data Link: https://s3.amazonaws.com/postman-static-getpostman-com/postman-docs/ramen.json

Code I used:

pm.test("Body contains City", function () {
    pm.expect(pm.response.text()).to.include(pm.iterationData.get("City"));
    // older syntax still works too: with dot or bracket notation
    pm.expect(pm.response.text()).to.include(data.City); 
    console.log("City to be sent: " + data["City"]); 
});

I want Test Results of all JSON Test Data Iterations. But when running through collection runner I'm getting the value of First Iteration alone in Collection as well as Postman Console. But when running the CSV file I can see results for 35 Iterations.

Tell me what should I do to get Test Results for 35 JSON Iterations.