我已经定义了几个Postman测试集合/文件夹及其相关的测试数据文件。通过Postman Collection Runner和Newman分别运行它们可以很好地工作。我想一起批处理多个运行,就像Windows中的这个.bat:
SET postman_collection=Regression.postman_collection.json
SET postman_environment=Development.postman_environment.json
SET postman_folder="Order details"
SET postman_data="orders.json"
newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%
SET postman_folder="Fuzzy Search"
SET postman_data="fuzzy search regression.csv"
newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%
SET postman_folder="Sorting"
SET postman_data=""
newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%但是,执行将在第一次newman运行完成后结束。我认为出于某种原因,它会终止控制台。
我怎样才能实现上面我想做的事情呢?我的测试结构不正确吗?如有任何帮助,我们不胜感激!
发布于 2018-04-10 16:41:39
您只需在newman命令前使用"call“,如下所示:
SET postman_collection=Regression.postman_collection.json
SET postman_environment=Development.postman_environment.json
SET postman_folder="Order details"
SET postman_data="orders.json"
call newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%
SET postman_folder="Fuzzy Search"
SET postman_data="fuzzy search regression.csv"
call newman run %postman_collection% -r html,cli -e %postman_environment% --folder %postman_folder% -d %postman_data%https://stackoverflow.com/questions/44320112
复制相似问题