可以将所有测试和请求的结果导出到文件中,然后导入到Postman中进行进一步分析。使用JSON报告程序和文件名将运行器输出保存到文件中。
我已经尝试过:
newman run "Echo.postman_collection.json" --reporters cli,json --reporter-json-export outputfile.json
Run Code Online (Sandbox Code Playgroud)
但是我没有设法将outputfile.json导入Postman Collection Runner。我总是收到以下错误消息:
Runner.js:81831未捕获的数据错误:无法在“ IDBObjectStore”上执行“ put”:评估对象存储的键路径未产生值。
我究竟做错了什么?
这是Newman创建的outputfile.json。它实际上具有与Postman Collection Runner中导出的测试运行不同的结构:
{
  "collection": {
    "info": {
      "id": "ef224090-5564-258f-6ca5-68bd578a6c8d",
      "name": "Echo",
      "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
    },
    "event": [],
    "variable": [],
    "item": [
      {
        "id": "2cf3e4a4-eb9e-4622-bade-d0536161c97d",
        "name": "Delay",
        "request": {
          "url": "https://postman-echo.com/delay/3",
          "method": "GET",
          "body": {
            "mode": "raw",
            "raw": ""
          },
          "description": {
            "content": "",
            "type": "text/plain"
          }
        },
        "response": [],
        "event": [
          {
            "listen": "test",
            "script": {
              "type": "text/javascript",
              "exec": …Run Code Online (Sandbox Code Playgroud)