首页 > 解决方案 > postman 集合的特定文件夹从工具成功运行,但在使用 --folder 选项从 newman 工具运行时抛出 401 错误

问题描述

postman 集合文件具有从 postman 配置并成功运行的环境设置、全局变量和数据文件

来自纽曼

newman run -e ..\..\Source\ABCDEF\test\Automation\API_Webservices\Environment\GHIJ_QA.postman_environment.json -g ..\..\Source\LMNOPQRSTUV\test\Automation\API_Webservices\Globals\A12345_4568.postman_globals.json --folder Folder1 -d ..\..\Source\LMNOPQRSTUV\test\Automation\API_Webservices\TestData\test.json ..\..\Source\LMNOPQRSTUV\test\Automation\API_Webservices\Collections\MicroServices\A12345_4568\MicroServices.postman_collection.json -r htmlextra --reporter-htmlextra-export ..\..\Source\LMNOPQRSTUV\test\Automation\API_Webservices\Output\Output_HTMLReport.html

expected response to have status code 200 but got 401
RESPONSE INFORMATION
Response Code:401 - Unauthorized

实施的文件夹级服务需要作为单个文件夹或多个文件夹依次运行,以检查简单和高级流程。

目前,这不适用于 newman CLI,而仅适用于工具。 是否应该将脚本中使用的集合变量设为全局以在 newman 中工作?这是一个可能的问题吗?请说明一下

标签: collectionsautomationdirectorypostmannewman

解决方案


推荐阅读