Forum Discussion
richie
Community Hero
Hi RandomTester,
I'm a little confused so csn you clarify the following? It's possible with groovy but the scripters that may be able to help would need a lot more info:
You have an initial GET that returns a payload....what's the datatype of the response payload? You mention SOAP which means it must be XML, but you can but you dont often see a lot of complex nesting in XML, you seem to see more nesting in JSON. So! Is the datatype of your payloads XML/SOAP?
You have a GET, you grab response (which is large with nested attributes) edit it and then use some or all of the GETs response as the payload for a subsequent PUT PATCH or POST request?
When you say you 'edit it' how are you editing the response before you pass it onto the subsequent PUT/PATCH/POST.....are you not using groovy to do the editing? If not how are you editing the content before the transfer?
It would help to know what the current test steps you have in your testcases just to visualise??...e.g.
GET step
PropertyTransfer
Groovy
Properties
PUT/PATCH/POST step
It would also help people if they knew the structure and content of the response and request payloads you are talking about (just use dummy data if youre concerned about security)?
You say the payload of your GET is large with nested content and it'a time consuming to use the PropertyTransfer function and you'd like to use groovy, but even with groovy you would still have to code out a mapping between the attributes in your GET response to your PUT/PATCH/POST request so this could be time consuming also?
I understand what youre saying about if you have blank attributes it will blank out the field in the underlying database you are PUT/PATCH/POSTing to, but if you are using a specific records data from the GET in a subsequent update....if the attribute is blank in the GET surely you'd want to maintain that? Or am i misunderstanding the significance?
Ok..that's it for now,
Nice one,
Rich
I'm a little confused so csn you clarify the following? It's possible with groovy but the scripters that may be able to help would need a lot more info:
You have an initial GET that returns a payload....what's the datatype of the response payload? You mention SOAP which means it must be XML, but you can but you dont often see a lot of complex nesting in XML, you seem to see more nesting in JSON. So! Is the datatype of your payloads XML/SOAP?
You have a GET, you grab response (which is large with nested attributes) edit it and then use some or all of the GETs response as the payload for a subsequent PUT PATCH or POST request?
When you say you 'edit it' how are you editing the response before you pass it onto the subsequent PUT/PATCH/POST.....are you not using groovy to do the editing? If not how are you editing the content before the transfer?
It would help to know what the current test steps you have in your testcases just to visualise??...e.g.
GET step
PropertyTransfer
Groovy
Properties
PUT/PATCH/POST step
It would also help people if they knew the structure and content of the response and request payloads you are talking about (just use dummy data if youre concerned about security)?
You say the payload of your GET is large with nested content and it'a time consuming to use the PropertyTransfer function and you'd like to use groovy, but even with groovy you would still have to code out a mapping between the attributes in your GET response to your PUT/PATCH/POST request so this could be time consuming also?
I understand what youre saying about if you have blank attributes it will blank out the field in the underlying database you are PUT/PATCH/POSTing to, but if you are using a specific records data from the GET in a subsequent update....if the attribute is blank in the GET surely you'd want to maintain that? Or am i misunderstanding the significance?
Ok..that's it for now,
Nice one,
Rich
sonya_m
5 years agoSmartBear Alumni (Retired)
Hi RandomTester , we clearly would need more information about your situation to be able to suggest something. Please elaborate. Thank you.
Related Content
- 7 years ago
- 10 years ago
Recent Discussions
- 13 hours ago