【问题标题】:Postman-to-k6 tool - The "path" argument must be of type string. Received an instance of ArrayPostman-to-k6 工具 - “路径”参数必须是字符串类型。收到 Array 的实例
【发布时间】:2021-10-01 14:12:09
【问题描述】:

我正在尝试使用实用程序 postman-to-k6 将邮递员集合转换为 K6。 postman-to-k6 工作得非常好,当集合具有简单的请求(如 Get 和 Post)以及简单的键值对 json 主体时,它会将集合转换为 k6.js 脚本。

但是当我想转换一个使用formdata上传文件的集合时,命令

postman-to-k6 .\collection.JSON -o K6-script.js

失败。给我错误

The "path" argument must be of type string. Received an instance of Array

邮递员集合非常庞大,其中包含敏感数据和使用文件上传的多个请求。无法在此处共享该集合。(我再次假设它由于表单数据而失败)

有什么方法可以找出问题的原因吗?

仅供参考:该系列在邮递员中也可以正常工作。

【问题讨论】:

  • 我有同样的问题,但无法找到解决方案。你能做到吗?我得到的唯一参考是“我们建议您在 api-deck/postman-to-k6 上发布您的问题。该项目在此分支上处于活动状态并得到维护。”

标签: collections postman k6


【解决方案1】:

尝试使用以下命令,它对我有用,并且至少产生了部分输出,我可以确定它破坏的地方:

postman-to-k6 my.postman_collection.json -e my-env.postman_environment.json --skip-pre --skip-post -s -o k6-output.js

基本上使用 -s(--separate 选项),您也可以选择使用 --skip-pre 和 --skip-post。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-21
    • 1970-01-01
    • 1970-01-01
    • 2020-06-20
    • 2021-12-07
    • 2019-10-10
    • 1970-01-01
    相关资源
    最近更新 更多