I have 2 json rest services my condition to t开发者_StackOverflowest them is like, I will give request to one json service which in turn give me the response which I will use as one of the json input object for 2nd json service. For Example, My json1 has given response as 221 which I will use that and frame json object like
{id:221,name:'test Json'}
and pass it over to json2 where 221 is the response from json1. Will that be possible? Can anyone please explain?
Thanks,
KarthikYes, use the Property transfer functionality in SOAPUI. Store your response in a variable (property) and pass it over with standard format ${#Variable} to next test step
There are multiple ways to achieve this 1st one is:
- Use property transfer to get the value from the response and store it in the properties step.
- Use
${Properties#propName}
to fetch the value of the property into your request where you want to use the value.
2nd approach will be to use groovy script
- Add a groovy script step after your 1st request and Use jsonParser to parse the response and fetch the desired value and store it in properties step
- Same as method 1's step 2.
精彩评论