Forum Discussion

Yangjiu2007's avatar
Yangjiu2007
New Contributor
16 years ago

Question: How to save every response info in a series of TestStep. Thanks !

Question: How to save every response info in a series of TestStep. Thanks !

Detail: I have designed some TestSteps in SOAPUI, and I can run them in serial automatically. Now I need to save every SOAP Request and Response info in each TestStep. I know that the "Dump File" tag in "Request Details Tab" can save the current TestStep SOAP info to a given file, but I don't know how to save  every SOAP Request and Response info to the same output file. Thank you for your help!

Thanks for your attention!

3 Replies

  • shbgupta_2000's avatar
    shbgupta_2000
    Occasional Contributor
    Hi,

    using groovy script u can save the teststep request and response...


    example:
    after each teststep(testcase execution) add the groovy script test step. Add the below code it will write request and responses to log files...


    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
    def request = groovyUtils.getXmlHolder("test case Name#Request")
    def response = groovyUtils.getXmlHolder("test case Name#Response")

    log.info("Request..."+request.getXml())
    log.info("Response..."+response.getXml())


    Thanks
    SHBGupta
  • mkp's avatar
    mkp
    Occasional Contributor
    It’s really great that you have designed some TestSteps in SOAPUI. I am also planning to design such one. So this thread was really helpful one for me as it provided me much valuable information regarding the designing of TestSteps such as saving response info. Till reading this thread I thought we can only save the current TestStep SOAP info to a given file by using the Dump File tag in Request Details Tab. After reading the reply posted by shbguptha, I came to know that there is an alternate way to save the TestStep request and response using groovy script.