Forum Discussion
Radford
8 years agoSuper Contributor
I'm not sure what version you are using and or what the exact issue you are experiencing is, but in version 1.7 I use the following to run test cases from groovy script:
import com.eviware.soapui.support.types.StringToObjectMap def testCase = testRunner.getTestCase().getTestSuite().getTestCaseByName('TestCase 2') def testCaseRunner = testCase.run(new StringToObjectMap(), false) def testStepResults = testCaseRunner.getResults() testStepResults.each{ testStepResult -> log.info('TestStep "' + testStepResult.getTestStep().getName() + '" result = ' + testStepResult.getStatus().toString()) }
My "Test Case 2" being called in the above example was just a test case that had two groovy test steps, one that succeeded, and one that failed (easily done with a couple of assert statements).
This gave the output:
Tue Oct 25 16:55:04 BST 2016:INFO:TestStep "Groovy Script 1" result = OK
Tue Oct 25 16:55:04 BST 2016:INFO:TestStep "Groovy Script 2" result = FAILED
Related Content
- 3 years agoEgg