Forum Discussion

Liberty_Informa's avatar
Liberty_Informa
Regular Contributor
12 years ago

TestCase Options

Hi

Is there any way we can apply following TestCase options in a single step or may be through groovy script?

We want to set "TestCase timeout" also we want to set the property which says "Discard OK Options" at the test case level.

Setting these options in each test case by hand is a pain.

Please refer below screen shot. We are talking about following options.
  • Hi,

    I'm really sorry for the delay in response time. We've been really swamped these last couple of weeks. Yes, this is definitely possible. Take a look at WsdlTestCase in the API docs - http://www.soapui.org/apidocs/com/eviwa ... tCase.html

    You can change the settings you mention programmatically using the setDiscardOkResults(boolean discardOkResults) and setTimeout(long timeout) methods respectively.

    With this in mind, you can simply iterate over your TestCases (for instance using this method in the WsdlTestSuite class - http://www.soapui.org/apidocs/com/eviwa ... ases%28%29) and change the setting for every TestCase.

    I hope this is of assistance to you.

    --
    Regards

    Arian
    SmartBear Sweden
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Hi Arian

    Thank you for the reply.

    I followed your steps and it is working however these settings, specifically the one which says 'Discard OK results...' has given birth to another problem.

    We maintain XML payload outside soapUI. We make use of property expansion to read the payload. Our requests look something like this


    <request>
    ${#Project#requestHeader}
    ${#TestCase#requestData}
    </request>


    When I set 'Discard OK results....' property, developers are not able to examine XML structure. We use to view xml by clicking on test step in the Test Case Log. Now if I double click on test step soapUI complains that 'Result has been discarded' which is correct on it's part.

    Is there any other way that we should be able to examine expanded xml's as well as enforce 'Discard OK results' setting.

    Thank you.
  • Hi again,

    I have a suggestion for a solution to this issue. The test step results aren't discarded until the end of the test case, so you can for instance use a Groovy TestStep to save your XML request data (either to a property or to a file) before SoapUI throws it away.

    If you're not familiar with getting and setting properties through Groovy, here's a link to get you started:
    http://www.soapui.org/Scripting-Propert ... properties

    Let me know if this is unclear or if you have any more questions, and I'll happily assist further.

    Regards,

    Arian
    SmartBear Sweden