cancel
Showing results for 
Search instead for 
Did you mean: 

Set active environment by id or endpoint

Markal
Occasional Contributor

Set active environment by id or endpoint

Hi,
I'm working on a script in READYAPI and ran into the following problem. I have to create a script that switches environment 2 after the tests ran on environment 1. I have a solution for it, but it does not work on SOAP UI. Currently I use the environment names in the script to identify and change the envs. But in SOAP UI envrionments don't have names.

My question is there any other way to switch the environment from script? Like id or the endpoint? Or is there a way to get a list about the available environments?
Here is my code:

 

if(testRunner.testCase.project.getActiveEnvironment().name=="DevEnv")
{
	testRunner.testCase.project.setActiveEnvironment("IntegrationEnv")
	testRunner.gotoStepByName("TestStep1")
}

Thanks for the help!

2 REPLIES 2
JKambli
Staff

Re: Set active environment by id or endpoint

Hi,

 

Open Source SoapUI does not have environment feature, it script will not work.

 

Thanks



Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
nmrao
Community Hero

Re: Set active environment by id or endpoint

In case if it is needed to switch between the environments, if certain precautions are taken(use property expansion), that is possible in free version.

Keep all the properties related to one environment in a file and keep different properties for different environment. And pass the respective property file while running.

For more details, please have a look at the below thread.

http://stackoverflow.com/questions/37655778/soapui-ability-to-switch-between-database-connections-fo...


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors