Forum Discussion

dcomte's avatar
dcomte
New Contributor
15 years ago

crashing testSuite Setup Script running a test case in it

Hi

I am using the free version 3.5.1, and trying to use the setup script of a test suite to run an external test case, which has the actual setup operations that will be common to several test suites.

the suites are like this :
+ _setupScripts (Disabled)
+ project_setup
+ suite_setup
+ ... steps
+ suite_teardown
+ 00_actual_tests
+ ...test cases


and my setup script is like this :
import com.eviware.soapui.model.testsuite.TestRunner.Status

// get TestCase
def ts = testSuite
def p = ts.getProject()
def tst = p.testSuites["_setupScripts"]
def tc = tst.testCases["suite_setup"]

// run test synchrouously
def tcrunner = tc.run(null, false)

// show that it worked out ok
log.info tc.name + ": Status: $tcrunner.status, time taken for TestCase was: $tcrunner.timeTaken ms"

// assert that it didn't fail
assert tcrunner.status != Status.FAILED : tcrunner.reason


if I run it, the "tc.run" call triggers an empty error dialog (just the window border and title), then soapUI is all frozen and I have to kill it.

any idea what I'm doing wrong ?

1 Reply

  • dcomte's avatar
    dcomte
    New Contributor
    Never mind...

    changing "def ts = testSuite" to "def ts = context.getTestSuite()" solved the problem.

    but as both are the same object instance, I don't understand the error.

    log.info "testSuite=" + testSuite
    log.info "context.getTestSuite=" + context.getTestSuite()

    gives the same result :
    INFO:testSuite=com.eviware.soapui.impl.wsdl.WsdlTestSuite@1673d71
    INFO:context.getTestSuite=com.eviware.soapui.impl.wsdl.WsdlTestSuite@1673d71