为什么加特林在有效的jsonpath上失败

为什么加特林在有效的jsonpath上失败

本文介绍了为什么加特林在有效的jsonpath上失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对返回的正文进行了以下检查:(出于安全原因更改了值,但结构相同)

I have the following .check on my returned body: (I changed the values for security reasons but the structure is the same)

 .exec(http("Get ids")
          .post("GetIds")
          .body(ElFileBody("json/getIds.json")).asJson
          .check(jsonPath("$...Types..[?(@.Type == 'web')].id").findAll.saveAs("IDLlist"))

但是交易失败并显示"Gettting findAll.exists提取失败:尝试从返回的正文中提取值时预期输入结束"

But the transaction fails with "Gettting findAll.exists extraction crashed: end of input expected when trying to extract values from a returned body"

当我将事务刚刚失败的确切内容带到 http:/时,加特林打印失败事务的主体./jsonpath.com/和评估刚刚失败的jsonpath,我得到了没有问题的良好结果.这意味着返回的主体正确,并且jsonpath也正确.那是什么问题呢?

Gatling prints the body of the failed transaction, when I take the exact body that the transaction had just failed on to http://jsonpath.com/ andevaluate the jsonpath that had just failed, I get good results with no issues. This means that the returned body is correct and that the jsonpath is also correct.What is the issue then?

推荐答案

感谢加特林论坛的Stephane,我发现$ .. Files [?(@.Format =='DASH_Web')].URL是正确的作品而不是我的变化.

Thanks to Stephane from the Gatling forum, I found that $..Files[?(@.Format == 'DASH_Web')].URL is correct works instead of the variation that I had.

由于 http://jsonpath.com/能够使用我的原始语法提取正确的路径,认为重要的一点是要注意,加特林jsonpath的语法要保守得多.

Since http://jsonpath.com/ was able to extract the correct path using my original syntax, I think its important to note that Gatling jsonpath is much more conservative in its syntax.

这篇关于为什么加特林在有效的jsonpath上失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 05:38