Forum Discussion

MRakers's avatar
MRakers
New Contributor
10 years ago

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

  • 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?