Forum Discussion

kannan's avatar
kannan
Occasional Contributor
4 years ago

Calling a TestSuite from test step of another Test case

 I have a requirement to call a Test suite from test step of another Testcases.  

 

Project structure

 

Our Project structure is 

1.TestSuite1
     1.1 TestSuite1_Positive  
     1.2 TestSuite1_Negative 

 

2. TestSuite2
     2.1 TestSuite2_Positive.
     2.2 TestSuite2_Negative 

 

3. TestSuite3
     3.1 Runner

 

Requirement is to run TestSuite 1 from TestSuite3 --> Runner . Is there any way to achieve this ? 

 

Thanks in advance .

 

  • Hi kannan ,

     

    yes, it should be easy to implement it with groovy scripts.

     

     

    // groovy

    def testSuiteList = ["TestSuite1", "TestSuite2", "TestSuite3"]

    def ts= null

    testSuiteList.each {

        ts = testRunner.testCase.testSuite.project.testSuites[it]

        ts.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

    }

     

    Thanks,

    /Aaron

  • aaronpliu's avatar
    aaronpliu
    Frequent Contributor

    Hi kannan ,

     

    yes, it should be easy to implement it with groovy scripts.

     

     

    // groovy

    def testSuiteList = ["TestSuite1", "TestSuite2", "TestSuite3"]

    def ts= null

    testSuiteList.each {

        ts = testRunner.testCase.testSuite.project.testSuites[it]

        ts.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

    }

     

    Thanks,

    /Aaron

    • kannan's avatar
      kannan
      Occasional Contributor
      Perfect aaronpliu . This worked . One more question is there anyway to make it run in parallel ?
  • nmrao's avatar
    nmrao
    Champion Level 3
    You may want to take a look at the test case design to make each and every test is independent.
    Just think what you are achieving by having dependency.