Forum Discussion

SumitM's avatar
SumitM
Occasional Contributor
6 years ago

Unable to run setup script and tear down script while executing from command prompt

I have Setup script and Tear Down script in my SoapUI Pro Test Project which have multiple test suites inside of it.

While executing the project with a perticular suite name from command prompt, I am not able to run the Setup Script before the suite run and the Tear down script after the testrunner finishes the test run. Is there a way to run Setup script and tear down script from command prompt.

3 Replies

  • Hi SumitM,

     

    I think in that case you need to write your TearDown and Setup Script at your TestSuite Level not on Project Level,

    but you can achieve this via some groovy code:

     

    testSuite.runSetupScript(context, runner)

    In this case you need to set context and runner both. But i will suggest put your TearDown and Setup Script in appropriate place.

     

     

    • SumitM's avatar
      SumitM
      Occasional Contributor

      Hi HimanshuTayal,

      Thanks for the response.

      Can you please provide a code snippet or any screen sorts on how to achieve this via 

      testSuite.runSetupScript(context, runner)

       

      • groovyguy's avatar
        groovyguy
        Champion Level 1

        You would have to put a groovy script test step in wherever you need to trigger that setup/tear down script.