10 years ago
Pass JSON Content to Next Test Step using Properties Tranfer
I am creating a 3 step testcase.
1st step is Groovy Script which read a file that has JSON content. I am able to read it successfully. Say this is the JSON content read from file.
3rd step is a "HTTP Call" to a endpoint with JSON messages. Currently I have mentioned this in request body.
2nd step, I have used Properties Transfer step to pass read JSON content from 1st step to 3rd step "HTTP Call". Problem is I need to replace <ReplaceThisString> with the JSON content read from first step. So this is what I want after execution of the Properties Transfer step.
Can any one help, how can I do that?
- Rohit
1st step is Groovy Script which read a file that has JSON content. I am able to read it successfully. Say this is the JSON content read from file.
{"name":"John Sid"}
3rd step is a "HTTP Call" to a endpoint with JSON messages. Currently I have mentioned this in request body.
{"body":"<ReplaceThisString>"}
2nd step, I have used Properties Transfer step to pass read JSON content from 1st step to 3rd step "HTTP Call". Problem is I need to replace <ReplaceThisString> with the JSON content read from first step. So this is what I want after execution of the Properties Transfer step.
{"body":"{\"name\":\"John Sid\"}"}
Can any one help, how can I do that?
- Rohit