Forum Discussion

canpan14's avatar
canpan14
Occasional Contributor
10 years ago

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 j...
  • nmrao's avatar
    nmrao
    10 years ago

    You may in the following fashion(exiting property transfer will become obselete in this case)

     

    1. 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')