soaprohit
7 years agoNew Contributor
Need help
how to access the 2nd token from the below json during the property transfer using json path
[
{
"name": "refresh-token",
"token": ""
},
{
"name": "session-id",
"token": ""
}
]
how to access the 2nd token from the below json during the property transfer using json path
[
{
"name": "refresh-token",
"token": ""
},
{
"name": "session-id",
"token": ""
}
]
Hi,
I don't know if I'm misunderstanding here - I'm assuming as you've raised this post in the Pro forum you have SoapUI Pro version? I'm guessing you just need to transfer the 2nd instance of the token node - right? If this is correct - the following will help - if its not correct, then it probably won't help! :)
The jsonpath to your second token is 'x[1].token' (sourced from http://jsonpathfinder.com/) - but the jsonpath syntax soapui uses is a little different
Instructions to do property transfer in Pro version are as follows:
1. Within your response frame, click on 'Outline' tab
2. Click on the 'Transfer to' button - here you have a choice - are you going for direct transfer or will you need the token value more than once? If more than once, after the 'Transfer to' button, select 'Add Properties Step'
3. A dialogue generates asking you to name the Properties step name - click Ok (for default)
4. A dialogue generates asking you to name the of the target property - click Ok (for default)
5. Transfer to Property form generates, ensure the 'Opens Property Transfer editor after finish' checkbox is ticked
This should auto populate the Property Transfer window with the jsonpath to the token node auto populated by default - as I said above - the jsonpathfinder site I used said the jsonpath was 'x[1].token' - considering the syntax that soapui uses for jsonpath it'll probably autopopulate to something like '$[1][token]'
The above is passing the token property to the Properties step - you can alter this later if you need.
have I answered your question?
if not - could you rephrase?
Cheers,
richie