canpan14
10 years agoOccasional Contributor
Transferring entire XML response using property transfer?
I'm currently calling a database and trying to move the reponse to a property using property transfer. The response comes in a nice xml form but when I try and use property transfer the property is just filled with blank. If I just do it only a single field it works fine, but doing it on the whole reponse doesn't work. I checked the 'Transfer Child Nodes' box but that didn't help either.
Any ideas, or other ways to go about this that would be better?
You may in the following fashion(exiting property transfer will become obselete in this case)
- Have the following script as part of script assertion to the jdbc request step, so that the response of the jdbc step would be saved into a given property, so that it can be used where it is needed later.
def response = messageExchange.responseContent assert null != response, "Response does not have any value" //provide appropriate name for property below def response = context.testCase.setPropertyValue('PROPERTY_NAME', response)
Later, you may get the property value in order to use like
- context.expand('${#TestCase#PROPERTRY_NAME}')
- context.testCase.getPropertyValue('PROPERTY_NAME')