I have a json Request like this:
{
"scopeId":"",
"scopeType":"",
"userId":"",
"fieldToBeEncryptedList":[
{
"srNo":"",
"fieldName":"",
"value":"",
"echoField":""
}
]
}
Now what I want is to set the value of each key dynamically which I got from response of other Test Step. How could I do this using groovy scripting.
Thanks in Advance.
You may have to do something like this:
Output:
Some details are missing in your question, but I suppose that you have two
REST TestSteps
, supposing that the first is calledREST Test Request
and the secondREST Test Request2
you can set the response and get request values for your testSteps using the follow groovy script inside agroovy TestStep
:This scripts gets your json and fill it with the values from the first
testStep
response, and then set this json as a request for the secondtestStep
.Hope this helps,