我在 Robot Frame Work 中有一个变量,具有以下格式的 Json 响应主体
{
"jsonrpc": "2.0",
"id": "787878",
"result":
{
"content":
[
{
"id": 30,
"userID": "user",
"eventType":
{
"name": "test"
},
"timestamp": "2013-03-13T11:00:28.537Z",
"source": "Service",
"reason": null,
"comment": null,
"dataCache":
{
"lastLogin":
{
"id": 103,
"fieldName": "value1",
"newValue": "Wed Mar 13 07:00:28 EDT 2013",
"oldValue": null,
"type": "java.util.Date",
"auditEvent": null
}
},
"authority": "authenticate",
"auditedObject": null
}
],
"pageNumber": 0,
"pageSize": 99,
"numberOfElements": 1,
"totalElements": 1,
"lastPage": true,
"totalPages": 1
}
}
SO from this How can I get the content only datacache 如下所示
{
"lastLogin":
{
"id": 103,
"fieldName": "value1",
"newValue": "Wed Mar 13 07:00:28 EDT 2013",
"oldValue": null,
"type": "java.util.Date",
"auditEvent": null
}
},
如果我使用类似的变量${variable['result']['content']}
,我将在内容中获得整个正文但我只想要“DataCache”中的正文:
请帮我解决这个问题..