Forum Discussion

jimisshah's avatar
jimisshah
New Contributor
7 years ago

How to trigger tear down script explicitly

My requirement is that I have a set of test data which I will pass to my test case (which has a combination of restrequest and groovy teststeps).. I am handling the execution of the test steps in a loop written in the setup script.. At the end of the setup script, test runner invokes all the test steps in the test case again once.. I do not want the testrunner to execute the test case again.. So how can I stop it from executing ? Is there a way I can directly trigger the teardown script at the end of my setup script so that testrunner does not execute the test case ?

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    1. can you please show the script?
    2. show the structure of the test case?
    3. what do you want to have in tear down script?
    4. why are you running the test steps in setup script itself while they can be executed as part of test case?
    • jimisshah's avatar
      jimisshah
      New Contributor

       

       

       

       

      Firstly, I confess that, I am quite new to using Ready API..

       

      nmrao: Below are the answers to your questions

       

      1. Its a for loop which will loop the testcase for the number of times its name appears in the test data (excel)

      2. TestCase structure is not the same across test cases.. But, it will have a combination of Rest Request calls and Groovy scripts

      3. I just want to trigger the tear down script so as to avoid soap ui test runner to execute the test case

      4. Its part of the framework which is in place, so I can't really modify the way the test cases are being executed..

       

      Lets say in soap ui, I have a project, with a test suite which has 3 test cases. Each case has some 5 steps (say 2 groovy steps and 3 rest request steps)..

       

      ProjectA

         --> TestSuiteA

            --> TestCase1

               --> GroovyStep1

               --> RestRequestStep1

               --> RestRequestStep2

               --> RestRequestStep3

               --> GroovyStep2

            --> TestCase2

               --> GroovyStep1

               --> RestRequestStep1

               --> RestRequestStep2

               --> RestRequestStep3

               --> GroovyStep2

            --> TestCase3

               --> GroovyStep1

               --> RestRequestStep1

               --> RestRequestStep2

               --> RestRequestStep3

               --> GroovyStep2

       

      With the above setup, I have an excel sheet which has 15 rows of data, 5 for each TestCase.. In this case, how can I execute the cases with all the different sets of test data from the test case itself (considering, I am not using the setup script way, that we currently have) ?

      • nmrao's avatar
        nmrao
        Champion Level 3
        Thank you so much for answering the requests patiently, will go thru it and will come back to this thread.

        By the way, would you mind showing the current script which you are using in setup script?