【发布时间】:2020-08-04 11:33:29
【问题描述】:
我有一个打印一些东西的两行 json 路径表达式,我想把它全部放在一行中:
Given path 'device/'
When method get
Then status 200
#This correctly prints the value:
And def device_search = $.device[?(@.manufacturer == 'a manufacturer')]
And print device_search[0].id
#This doesn't work (prints null):
And print $.device[?(@.manufacturer == 'a manufacturer')][0].id
谢谢!
【问题讨论】:
-
$.device[?(@.manufacturer == 'a manufacturer')].id[0] -
是的,我试过了,但没有成功(null)
-
@italktothewind 哈哈。你真的需要找个魔术师
标签: karate