Forum Discussion

SiKing's avatar
SiKing
Community Expert
11 years ago

[Resolved] running testCase from testSuite teardown

I have a somewhat complicated test - testing for a race condition - so I have several testcase in a testsuite all run in parallel. The last testcase - one that verifies all the results - in the suite needs to be run only after all the other testcases are done.

I have achieved this by having my last verification case disabled, and I run it from the testsuite teardown script with:
testSuite.getTestCaseByName("verification").run((com.eviware.soapui.support.types.StringToObjectMap)context, true)

What does the second (boolean) parameter do?

If I boil down my verification testcase again to the bare minimum (for the purposes of this discussion) I have just a Groovy script:

try {
assert false : "failed assert"
} catch(Exception) {
testRunner.fail("failed testrunner")
}


When I run this setup from the GUI, the testcase fails (turn red), however the testsuite passes (stays green). How do I get the testsuite to "fail"?

When I run this setup from the command line testrunner, everything passes and I do not see either of the above messages. How do I get the testsuite to "fail"? Where should these two message be logged?