Forum Discussion

mpunjani's avatar
mpunjani
Occasional Contributor
13 years ago

Automatically saving request and response files

Hi All,

I am using SoapUI Pro 3.6.1. I would like to automatically save all the request and response messages (executed) to any file (no matter which extension).

I found the script below (FYI I dont know anything about scripts or how they work)
filePath = 'c:/'
fos = new FileOutputStream( filePath + testStepResult.testStep.label + '.txt', true )
pw = new PrintWriter( fos )
testStepResult.writeTo( pw )
pw.close()
fos.close()

I closed my SoapUI project and restarted and ran a test request from one of the test suite. But there was no output file in C drive.

I think I will require some basic information here (step-by-step)

Can anyone please help?

Thanks
Mak

5 Replies

  • If you use Fiddler as a proxy, you can save archives of all requests and responses out of SoapUI. This might be easier than finding or writing code that will let you do this.

    1. Download Fiddler here: http://www.fiddler2.com
    2. Install Fiddler
    3. Set SoapUI => Preferences => Proxy Settings to host = 127.0.0.1 and port 8888. Check off "enable using proxy." When Fiddler is open, this will send your SoapUI requests through Fiddler.
    4. Open Fiddler.
    5. Send your requests through SoapUI. (You can filter traffic through Fiddler to show only requests made to to certain hosts.)
    6. In Fiddler, use the File => Save option to save a Fiddler archive of all or selected requests/responses.

    This isn't an automatic save, but it might get you where you want to go.
  • Hi,
    There is support available in SoapUI. Launch test execution using testRunner(select test suite/test case and right click to find option)
    In the reports tab of testRunner select ExportAll check box and select RootFolder to export. soapUI creates a text file for every step in the test case to this folder. This file contains request and response etc information. Hope this meets your requirement.

    Thanks,
    Narasimharao
  • mpunjani's avatar
    mpunjani
    Occasional Contributor
    Thanks
    electric Insurance Company Support wrote:
    If you use Fiddler as a proxy, you can save archives of all requests and responses out of SoapUI. This might be easier than finding or writing code that will let you do this.

    1. Download Fiddler here: http://www.fiddler2.com
    2. Install Fiddler
    3. Set SoapUI => Preferences => Proxy Settings to host = 127.0.0.1 and port 8888. Check off "enable using proxy." When Fiddler is open, this will send your SoapUI requests through Fiddler.
    4. Open Fiddler.
    5. Send your requests through SoapUI. (You can filter traffic through Fiddler to show only requests made to to certain hosts.)
    6. In Fiddler, use the File => Save option to save a Fiddler archive of all or selected requests/responses.

    This isn't an automatic save, but it might get you where you want to go.
  • Right Click your project and click on ---->Launch TestRunner--->Select Reports Tab--->Select/Check Export All and output directory

    All the request and Response will be saved to that directory.
  • I tried going to Project, Launch Test Runner- report Tab and Selected Report all and selected the directory. I am getting the following error "Running soapUI TestRunner for [R3_Courier]
    directory: C:\Program Files\eviware\soapUI-Pro-4.0.0\bin\.
    command: cmd.exe /C testrunner.bat -a -f"C:\Documents and Settings\JaikumJX\Desktop\SOAP UI Responses" "C:\Documents and Settings\JaikumJX\Desktop\R3 Documents\Automation Project\R3_Courier.xml"
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine."

    Please help.