Forum Discussion

Sri_Ram_Kumar's avatar
Sri_Ram_Kumar
Occasional Contributor
17 years ago

Re: How to dump the response directly into a spreadsheet

Hi,

Could anyone please let me know the groovy code/script that needs to be done in soapUI in order to dump the response values into a spreadsheet.

I am currently using SoapUI 2.0.2.

Thanks,
Sriram. G

2 Replies

  • Hi Sri,


    Your main concerns here are accessing the response and saving into a speadsheet.

    Response you can access in at least two ways:

    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
    def holder = groovyUtils.getXmlHolder( "MyTestRequestStep#Response" )
    log.info "XML formatted response: ${holder.xml}"

    or...

    def response = context.testCase.testSteps["MyTestRequestStep"].properties["Response"]
    log.info "Raw response: ${response.value}"


    You can program access to Excel spreadsheets using one of the third party libraries like JExcelApi.

    SoapUI Pro comes with Excel DataSink functionality built in which makes it a breeze to store responses (or really any property expanded value) into an Excel spreadsheet.


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla