python - How to get the required content from a JSON string -
i have variable in robot frame work having json response body in following format
{ "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 how can content of datacache shown in below
{ "lastlogin": { "id": 103, "fieldname": "value1", "newvalue": "wed mar 13 07:00:28 edt 2013", "oldvalue": null, "type": "java.util.date", "auditevent": null } }, if use variable ${variable['result']['content']} , entire body in content want body in "datacache":
please me solve issue..
${variable['result']['content'][0]['datacache']} is you're looking for? maybe need more practice json then...
Comments
Post a Comment