Ask a Question

Having problems Transfering Properties using JSONPath

MRakers
New Contributor

Having problems Transfering Properties using JSONPath

I recently upgraded to 5.1.1 and am trying to implement a Property Transfer using this new JSONPath, but seem to be having a problem.

My REST call returns a list of Customers in a JSON format. I'm trying to select the first Customer in the list.
When I use the "Select Source JSONPath feature I get: $.$resources[0].Id
But when I attempt to transfer this Id, I get a "Path '$' not found in the current context" error.

I've been able to do similar transfers using the ResponseAsXML property, but in this case, no XML is returned. I need to go straight at the JSON to get my properties.

Any help would be appreciated.
2 REPLIES 2
veneta_hristova
New Member

Re: Having problems Transfering Properties using JSONPath

Hi gyus,

I'm facing the same problem "Path '$' not found in the current context". 

What I do:

Property Transfer Step - Property: Response, Path language: JSONPath
I want to use a property value of my TestCase Properies Step with the syntax that I use in Xpath before - ${Properties#nameOfTheProperty}.
My path is $..data[0].${Properties#nameOfTheProperty}

Can you please tell me the correct syntax when I use the JSONPATH for Property transfer?

Dima
New Contributor

Re: Having problems Transfering Properties using JSONPath

I use this tool http://ashphy.com/JSONPathOnlineEvaluator/
Just copy tour json and play with query in JsonPath Syntax field until have parameter you need. Then paste it in soapui.

cancel
Showing results for 
Search instead for 
Did you mean: