Forum Discussion
SmartBear_Suppo
11 years agoSmartBear Alumni (Retired)
Hi,
The option you found in the source code is for setting the end-point, not the environment. The environment is set through the -E (capital E) option and is only available in SoapUI Pro (so you won't find it in the Open Source code).
The correct way to get the active environment is as follows:
- Create a project-level property called "activeEnv" or any name you want to describe the active environment.
- Select each environment you have (open the relevant TestSuite) and set the value of the "activeEnv" property appropriately for each one.
- In a Groovy script print the value of the active environment as follows:
Regards,
Renato
SmartBear Software
The option you found in the source code is for setting the end-point, not the environment. The environment is set through the -E (capital E) option and is only available in SoapUI Pro (so you won't find it in the Open Source code).
The correct way to get the active environment is as follows:
- Create a project-level property called "activeEnv" or any name you want to describe the active environment.
- Select each environment you have (open the relevant TestSuite) and set the value of the "activeEnv" property appropriately for each one.
- In a Groovy script print the value of the active environment as follows:
def activeEnv = context.expand( '${#Project#activeEnv}' )
log.info "The active environment is $activeEnv"
Regards,
Renato
SmartBear Software
Related Content
- 9 months agoDGISQ