How to run JSON Test Data in Postman?

若如初见. 提交于 2019-12-11 17:21:08

问题


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.

来源:https://stackoverflow.com/questions/56696009/how-to-run-json-test-data-in-postman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!