Forum Discussion

Vivek_Malhotra's avatar
Vivek_Malhotra
Occasional Contributor
7 years ago

Do SOAPUI provide a switch to run a testsuite

Hi,

I have a requirement where in SOAPUI Project I need to have some setup which is disabled by default in the project and I need to enable it just on certain environments like DEV or INTE:

 

For e.g. by default the setup is disabled and the project uses some hard coded account values which should be used in CI environment.

 

However while running the same project on DEV Or INTE it enables the setup and dynamically create the accounts and use those acounts instead of hardcoded values.

 

Is it possible to have such a switch at project level in soaui

 

Many Thanks,

Vivek

5 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    I believe that enabling and disabling should be done conditionally. Then you need not to worry.
    • Vivek_Malhotra's avatar
      Vivek_Malhotra
      Occasional Contributor

       Thanks nmrao

      How to do that? I have a test suite with setup which has logic to create all accounts.

       

      Now where to put this condition?

       

      Thanks,

      Vivek

      • nmrao's avatar
        nmrao
        Champion Level 3
        Below statement gives you current environment.
        def currentEnv = testRunner.testCase.testSuite.project.activeEnvironment.name

        if (currentEnv in ['DEV', 'INTE']) {
        //move your existing logic here
        }