使用 .@ 读取 json 响应。功能文件失败

Reading json response with .@. fails in feature file

这是我的回复。

`

 { 
"Response": {
"_": {
  "QueryResponse": {
    "_": null,
    "@": {
      "totalCount": "55"
    }
  }
},
"@": {
  "time": "2020-12-22T18:21:58.862-08:00"
}
}
}

`

我在功能文件中这样做

* print "total count="+ result.session.runtimeData.read_count.Response._.QueryResponse.@.totalCount

并获得 <eval>:1:78 Expected ident but found error result.session.runtimeData.read_taxcode_count.Response._.QueryResponse.@.totalCount ^ in <eval> at line number 1 at column number 78

^ 指向@

尝试将其包含在 [''] 多个位置以供响应,但我无法获得值。

有时候你不需要把事情复杂化,试试这个:

* def count = get[0] response..totalCount

这也行得通:

* def count = response.Response._.QueryResponse['@'].totalCount