Forum Discussion

hoferGue's avatar
hoferGue
New Contributor
14 years ago

Running an existing Testcase in an setup script

Hi,

i just wanted to know if it is possible to run an existing testcase within

a) a setup/teardown script of another test suitee

b) a setup/teardown script of the testsuite containing the testcase

i have tried

import com.eviware.soapui.model.testsuite.TestRunner

def tc = testRunner.testCase.testSuite.project.testSuites[ "FullTest_ContainerService" ].testCases[ "Setup" ]

but it seems as if the script section is not capable of using the testrunner

thx for your help in advance
  • hoferGue's avatar
    hoferGue
    New Contributor
    hi i found a solution, which is rather easy

    def tc =testSuite.getTestCaseByName( "Setup" )
    def properties = new com.eviware.soapui.support.types.StringToObjectMap ()

    tc.run(properties, false)

    now i can call my setup/tear-down testcases from the script, in the normal testsuite they are disabled, and no even if an error occurs, everything is cleaned up
    • Gurbakhsish's avatar
      Gurbakhsish
      Occasional Contributor

      Hi, this does not seems valid for language javascript and on Ready 1.7.0. I am not able to find types module under com.eviware.soapui.support