Forum Discussion

Raju_Vusirikala's avatar
Raju_Vusirikala
Contributor
16 years ago

How to capture submitted soap request.

Hi Ole,

We can able to capture Resonse like
XmlHolder xmlHolder = groovyUtils.getXmlHolder(soapRequestStepName+"#Response");

By when we try similar for Request it is giving static request like which contains variables those will be replaced with values and submitted.

How can we capture actual submitted request?  I need to capture the request information which is avilable in Test Case Log under soapRequest Test Step.

Thanks
Raju.

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    you can get the actual request content via the TestStepResult object of the submitted request step;

    def requestXml = testRunner.results[testRunner.results.size()-1].requestContent

    def holder = groovyUtils.getXmlHolder( requestXml )
    ...

    regards,

    /Ole
    eviware.com
  • Thanks Ole,

    Your solution works great.

    But Incase of debugging the step  pain thing is I need to run previous step "SoapRequest" and Grooy Script Step every time, I couldn't run only Groovy Script for frequent debuggin as in case Response i can run only Groovy Script.

    Thanks
    Raju.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Raju,

    you could also access the response object directly;

    def response = testRunner.testCase.testStepsByName( "Request" ).testRequest.response
    def requestXml = response.requestContent

    This should work even if running separate step.

    regards!

    /Ole
    eviware.com