Forum Discussion

Tamas_Rev's avatar
Tamas_Rev
New Contributor
16 years ago

Retrieve LoadTest message body

Hi,

My current task is to extract some business data from a SoapUI load test results. I'm using soapUI 3.0.1. The thing that already works with any non-loadTest test case is this:

def result = testRunner.runTestStepByName(requestName);
def saver = new StringWriter();
result.writeTo(new PrintWriter(saver));

However, if I run it from a loadtest and log the results, I get something like this:

---------------- Request ---------------------------
<discarded>
---------------- Response --------------------------
- missing response / garbage collected -

Is there any way to preserve this data for further processing? I thought it might be a trick with the STATUS_PROPERTY of the TestCase interface, however, couldn't find the possible values of this field.

Regards,
Tamas

1 Reply

  • Tamas_Rev's avatar
    Tamas_Rev
    New Contributor
    Well, found a solution:

    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner;
    import com.eviware.soapui.support.types.StringToObjectMap;

    ...

    def tc = testRunner.getTestCase();
    tc.setDiscardOkResults(false);
    def tr = new WsdlTestCaseRunner(tc, new StringToObjectMap());
    def result = tr.runTestStep(tc.getTestStepByName( requestName ), false, true);


    I'll have to find a way to make it faster e.g. it'd enough to create one tc and tr for one loadtest.
    However, this is the basics of the solution.