[英]How to compare json list with another list in Gatling?
I have a json response with a list of strings.我有一个带有字符串列表的 json 响应。 I want to check if it contains the same elements as some other list (order of those elements isn't important. How do I do that?我想检查它是否包含与其他列表相同的元素(这些元素的顺序并不重要。我该怎么做?
I tried this:我试过这个:
jsonPath("$.country_codes[*]").findAll.sorted.is(List("DE", "CH", "FR", "IE", "IT", "NL", "RS", "UK", "IN").sorted)
but I'm getting error "Cannot resolve symbol sorted".但我收到错误“无法解析已排序的符号”。 If I don't use 'sorted', it works, but I can't rely on getting the same order of elements from server each time..如果我不使用“排序”,它会起作用,但我不能依赖每次从服务器获取相同顺序的元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.