Forum Discussion

joamello's avatar
joamello
New Contributor
13 years ago

running external test suite from groovy test step

Hello,

I'm Joan and my question is simple:
I have two test suites in one project. One of them contains only one test case which contains a groovy script. How can I run other test suite from this groovy script?

I was thinking to use something like this:
testRunner.testCase.testSuite["Test_Suite_Name"].runTestCaseByName["Test_Case_Name"]

Thank you in advance.

Joan.

6 Replies

  • Jasper175's avatar
    Jasper175
    Frequent Contributor
    Never figured out how to execute a full testsuite - but I have code to run a testCase in another suite.

    //--Define your testCase pointer
    def TC = testRunner.testCase.testSuite.project.getTestSuiteByName("Resource Manger (SRM)").getTestCaseByName("SRMTestCase")
    //--Define the external string object
    def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
    def async = false
    //--run object string against TC
    TC.run (properties, async)
  • Finan's avatar
    Finan
    Frequent Contributor
    import com.eviware.soapui.impl.wsdl.panels.support.MockTestSuiteRunner;
    import com.eviware.soapui.impl.wsdl.panels.support.MockTestSuiteRunContext;

    project = testRunner.getTestCase().testSuite.getProject();
    testSuite = project.getTestSuiteByName("TestSuiteName");

    mockRunner = new MockTestSuiteRunner(testSuite)
    mockContext = new MockTestSuiteRunContext( mockRunner )
    testSuite.runTearDownScript( mockContext, mockRunner )
    }

    Does this work for you?
    • Prassanna's avatar
      Prassanna
      New Contributor

      I was able to run this , But i was not able to access the mockRunner.results which is more important for me to make use of them for a beyond usage.

       

      Can anyone help me on this.

       

      Thanks & Regards,

      Prassanna S

      • groovyguy's avatar
        groovyguy
        Champion Level 1

        Prassanna, you may want to start a new thread. The one you have replied to is about 6 years old. If you start a new thread with your specifics and details it is far more likely you will find help.