需要运行集合多次迭代,并且需要运行我已声明 json 正文数据的 csv 文件

kan*_*ika 1 csv postman newman

我已经导出了邮递员的收藏。一个请求在 json body 中声明了一个变量。我有包含该变量数据的 csv 文件。现在我想在 Newman 命令行中使用 csv 文件(数据)运行多次迭代的集合

尝试多次运行

newman run collection_exported.json -n 3

它运行多次迭代(为此我没有包含该变量)

Json 主体有以下变量

"value":"{{medinfovalues}}"
Run Code Online (Sandbox Code Playgroud)

并且 csv 文件具有以下值

在此输入图像描述

Dan*_*ton 6

您需要使用-d <source>--iteration-data <source>cli 标志来告诉 Newman 数据文件的位置。

例如:

newman run collection_exported.json -d "filepath/myDataFile.csv" -n 3

有关所有不同 cli 标志的更多信息可以在此处找到:

https://github.com/postmanlabs/newman#newman-run-collection-file-source-options