I cannot get the inner nested key's value of this json object (it gets response from our API call, I just only copy the response from karate)
[
{
"code": 200,
"result": "[{"distinct":false,"operatetime":"2019-05-17 17:01:01","personid":"e8edec61-fd1a-4c69-8b60-fb8d21d06095","sampleid":"1c9410cd-608d-4eb1-8d12-c8f2faf7fca4"}]"
}
]
And def tempreponse = [{"code":200,"result":"[{"distinct":false,"operatetime":"2019-05-17 17:01:01","personid":"e8edec61-fd1a-4c69-8b60-fb8d21d06095","sampleid":"1c9410cd-608d-4eb1-8d12-c8f2faf7fca4"}]"}]
And def temp1 = tempreponse[0].result <- this sentence works
And def temp1 = tempreponse[0].result[0] <- however, this doesn't work, the print of temp1 is blank
In fact, I need to get the value of personid and sampleid, but failed
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…