本文介绍了空手道xml bodyPath在模拟中未匹配:方案匹配评估失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是请求的样子:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
...
<SOAP-ENV:Header>
<ns2:Security SOAP-ENV:mustUnderstand="1">
<ns2:UsernameToken>
...
</ns2:UsernameToken>
</ns2:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:customerQualificationRequest>
<ns1:header>
...
</ns1:header>
<ns1:creditApplication>
...
<ns1:lastName>Shopping</ns1:lastName>
...
</ns1:creditApplication>
</ns1:customerQualificationRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
和模拟:
Scenario: pathMatches('<path>') && requestHeaders['SOAPAction'][0] == '<soapAction>' && bodyPath('/ns1:customerQualificationRequest/ns1:creditApplication/ns1:lastName') == 'Shopping'
如果我仅删除bodyPath,但未找到与bodyPath匹配的内容,则该方法有效.我需要在几种情况下,lastName不同,因为答案会有所不同,因此我需要与该参数匹配.我在做什么错了?
It works if I just remove the bodyPath, but doesn't find a match with the bodyPath. I need to have several cases where the lastName is different as the answer would be different, so I need to match with that parameter.What am I doing wrong?
推荐答案
经过一段时间的努力,我找到了答案.以下工作:&& bodyPath('/Envelope/Body/customerQualificationRequest/creditApplication/lastName')
After struggling with it for a while, I found the answer. The following worked:&& bodyPath('/Envelope/Body/customerQualificationRequest/creditApplication/lastName')
这篇关于空手道xml bodyPath在模拟中未匹配:方案匹配评估失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!