AnsweredAssumed Answered

Devtest is throwing jsonpath is invalid

Question asked by balu_rk on Feb 6, 2019
Latest reply on Feb 7, 2019 by balu_rk

I was trying to retrieve a data from the json response by passing the jsonpath through assertion. Below is the json response,

"messageHeader": {
"acknowledgement": "All",
"messageType": "D",
"credentials": {"alias": "TEST"},
"sourceSystem": "test",
"expiryTime": "2020-02-05T11:04:00.000+0000",
"messageID": "1001.1",
"correlationID": "AAO",
"reply": {
"reply.data": "\n\t\t FINAL \n\t",
"reply.status": "failed"
},
"userId": "balurk",
"trackingID": "DDD"
}

 

In this json, i'm trying to retrieve the text from "reply.data". I used the json path : $.messageHeader.reply.[reply.data]

This jsonpath works fine when i use it in some jsonpath online sites. But the same is not working from Devtest run time and is throwing "The specified JSON path is invalid. JSON path = '$.messageHeader.reply.[reply.data]'". 

Can someone please suggest some solutions?

Outcomes