Forum Discussion

lc25s's avatar
lc25s
Occasional Contributor
11 years ago

Returning XML when using "Run TestCase" test step

I have basic tests set up with the following test steps

//=============
// Test Case A
//=============
Test Case A
TestRequest
MockResponse
Groovy - to verify XML returned in steps above (values stored in RawRequest, Request and Response)

//=============
// Test Case B
//=============
Test Case B
Run TestCaseA - Run TestCase test step
TestRequest
MockResponse
Groovy - to verify XML returned in steps above (values stored in RawRequest, Request and Response)

When running Test Case B, the "Run TestCase" test step fails because the Groovy script in Test Case A fails due to the fact that the XML values for RawRequest, Request and Response properties of that test case are not updated when using that test step (it works fine when run as a Test Case itself)

Is there a way for the XML values to populate when using the Run TestCase test step?

1 Reply

  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    I created a similar script, mine is completely controlled VIA groovy though and it has a UI and works rather well. I posted the code here and commented the majority of the code decently well. Feel free to edit, use or copy what you need. I don't have access to my work computer right now so I can not be of too much more assistance.

    http://forum.soapui.org/viewtopic.php?f=5&t=22445&sid=a3fb892aa2e9054c57b6e91bbffe9348


    Feel free to ask for help with the code anywhere you may need it if you choose to use it. Currently it uses a property file style for the inputs and tags within the xml like [property] where property would be what's found as the key in the property file (Ex. FirstName = Paul would replace [FirstName] with Paul).