cancel
Showing results for 
Search instead for 
Did you mean: 

Do SOAPUI provide a switch to run a testsuite

Occasional Contributor

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 5
Community Hero

Re: Do SOAPUI provide a switch to run a testsuite

I believe that enabling and disabling should be done conditionally. Then you need not to worry.


Regards,
Rao.
Occasional Contributor

Re: Do SOAPUI provide a switch to run a testsuite

 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

Community Hero

Re: Do SOAPUI provide a switch to run a testsuite

Below statement gives you current environment.
def currentEnv = testRunner.testCase.testSuite.project.activeEnvironment.name

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


Regards,
Rao.
Occasional Contributor

Re: Do SOAPUI provide a switch to run a testsuite

Thanks @nmrao 

 

When i write this script it gives me below output. What does this mean? Where to pass the environment?

 

 

Tue Jul 11 12:01:44 CEST 2017:INFOSmiley Very Happyefault environment

Community Hero

Re: Do SOAPUI provide a switch to run a testsuite

Please show your existing script.


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win