Karate 字符串不支持的匹配类型:每个_等于

Karate 字符串不支持的匹配类型:每个_等于,karate,Karate,抄袭 我收到以下错误消息: unsupported match type for string: EACH_EQUALS 对于此步骤: * match each response/list/cost/Rate == 0.920509 对于此xml: <list> <cost> <Rate>#present</Rate> // contains 0.920509 </cost> <cost

抄袭

我收到以下错误消息:

unsupported match type for string: EACH_EQUALS
对于此步骤:

* match each response/list/cost/Rate == 0.920509
对于此xml:

<list>
    <cost>
        <Rate>#present</Rate> // contains 0.920509
    </cost>
    <cost>
        <Rate>#ignore</Rate>
    </cost>
</list>

#当前//包含0.920509
#忽略

我不知道为什么这不起作用…

每个
只在列表(或数组)上运行,所以使用双斜杠:

* def response =
"""
<list>
    <cost>
        <Rate>0.920509</Rate>
    </cost>
    <cost>
        <Rate>0.920509</Rate>
    </cost>
</list>
"""
* match //Rate == ['0.920509', '0.920509']

* def temp = //Rate
* match each temp == '0.920509'
*def响应=
"""
0.920509
0.920509
"""
*匹配//速率==['0.920509','0.920509']
*def temp=//速率
*匹配每个温度==“0.920509”
这会给你足够的提示继续

XML可能很棘手,因此如果您真的陷入困境,请将其转换为JSON: