Forum Discussion

rah's avatar
rah
Occasional Contributor
17 years ago

Retrieve TestRunner from TestCase

If I know the currently run TestCase is there a way to retrieve the TestRunner object?
How?
Or is there a way to define a global variable that is accessible through all Projects/TestCases/MockServices ?

Thanks for your help.

1 Reply

  • Hi ,

    every test case has implicitly defined log, testCase, context, testRunner that you can use in groovy script.

    But if you want to handle other testcases objects in the same project here is some snippets that hopefully can help you:

    to get any testcase in project you can use this
    def testcase = testRunner.testCase.testSuite.project.testSuites["TestSuiteName"].getTestCaseByName ("TestCaseName")

    and create runner for it
    def runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner( testcase,null );

    Let us know if this helps.

    regards,

    Nebojsa
    eviware.com