Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postman 邮递员或接线员_Postman_Postman Collection Runner - Fatal编程技术网

Postman 邮递员或接线员

Postman 邮递员或接线员,postman,postman-collection-runner,Postman,Postman Collection Runner,我将测试结果视为通过字段A为“A”或字段B为“B”。我怎样才能在《邮递员》中做到这一点 我试过了 (pm.expect(responseJson.output.generic[0].fieldA).to.eql(pm.iterationData.get("A"))||pm.expect(responseJson.output.generic[0].fieldB).to.eql(pm.iterationData.get("B"))) 你可以试试 pm.ex

我将测试结果视为通过字段A为“A”或字段B为“B”。我怎样才能在《邮递员》中做到这一点

我试过了

(pm.expect(responseJson.output.generic[0].fieldA).to.eql(pm.iterationData.get("A"))||pm.expect(responseJson.output.generic[0].fieldB).to.eql(pm.iterationData.get("B")))
你可以试试

pm.expect(cond1 | | cond2).to.be.true

在你的情况下,我想那应该是

pm.expect(
    responseJson.output.generic[0].fieldA === pm.iterationData.get("A") || 
    responseJson.output.generic[0].fieldB === pm.iterationData.get("B")
  ).to.be.true;