Forum Discussion

agupta1's avatar
agupta1
Contributor
16 years ago

Simulate "Run TestCase" in groovy script

I want to perform some operations in my startup script and one of it is to execute a test case (that has input and output parameters) just like "Run TestCase" step.

I tried the following

def caseDef = testRunner.testCase.testSuite.project.testSuites['Suite1'].testCases['case1']
def tr = new WsdlTestCaseRunner(caseDef, new StringToObjectMap());
tr.run()

This does execute the testcase, but input and output parametes are not exchanged. If I perform testRunner.runTestStepByName() for a test step, the parameters are exchanged.

Any help....

1 Reply

  • Try something like this

    teardown_testcase = testCase.testSuite.project.getTestSuiteByName("Common").testCases["MyTestCase"]
    teardown_testcase.setPropertyValue("prop1", "mypropvalue")
    runner = teardown_testcase.run( new com.eviware.soapui.support.types.StringToObjectMap(), false )
          myprop2 = teardown_testcase.getPropertyValue("prop2")