[英]Reading json response with .@. fails in feature file
This is my response.这是我的回应。
` `
{
"Response": {
"_": {
"QueryResponse": {
"_": null,
"@": {
"totalCount": "55"
}
}
},
"@": {
"time": "2020-12-22T18:21:58.862-08:00"
}
}
}
` `
I am doing this in feature file我在功能文件中这样做
* print "total count="+ result.session.runtimeData.read_count.Response._.QueryResponse.@.totalCount
and getting <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
并获得
<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
^ points to @ ^ 指向@
tried enclosing it in [''] many places for the response but I am not able to get the value.尝试将其包含在 [''] 许多地方以进行响应,但我无法获得该值。
Sometimes you don't need to complicate things, try this:有时你不需要把事情复杂化,试试这个:
* def count = get[0] response..totalCount
Also this would have worked:这也行得通:
* def count = response.Response._.QueryResponse['@'].totalCount
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.