【发布时间】:2022-10-21 14:51:55
【问题描述】:
在我的空手道测试中,我有如下 Xml 响应
<wkfcnf:workflow xmlns:wkfcnf="http://test.com/ri/configuration" name="test" status="ACTIVE" >
<protocols>
<protocol name="protocol1" uri="https://test/url/2"/>
<protocol name="protocol2" uri="https://test/url/2"/>
</protocols>
<stages>
<stage name="stage1" uri="https://stage/1"/>
<stage name="stage2" uri="https://stage/1"/>
</stages>
</wkfcnf:workflow>
我想根据协议名称获取协议 Uri。
以下是我尝试过的代码。但没有按预期工作。
* json prepProtocol = $response/workflow/protocols/protocol[(@.name='protocol1')]
对此的任何帮助表示赞赏。
谢谢 须弥陀
【问题讨论】:
标签: karate