Forum Discussion
Only the active environment's custom property is set by the Load Script when the project is loaded, switching to an inactive environment removes the custom property
You can try the following groovy script code to set the property value per Environment:
int names = testRunner.testCase.testSuite.project.getEnvironmentCount(); def proj = testRunner.testCase.testSuite.project; for (int i = 0; i < names; i++) { def env = testRunner.testCase.testSuite.project.getEnvironmentAt(i); proj.setActiveEnvironment(env.name); proj.setPropertyValue("PropertyName", "PropertyValue"); }
- zorglups5 years agoOccasional Contributor
Thank you for the script.
I still think that one should have a way to define a project property that is global to all environments.
- Radford5 years agoSuper Contributor
Have you looked at Global Properties?
https://support.smartbear.com/readyapi/docs/configure/preferences/global-properties.html
These may or may not suit your need.
- zorglups5 years agoOccasional Contributor
Yes. Sure I know the Global Properties.
I still think one should have Project Global Properties :smileyhappy:
Or a boolean that would set a Project Properties "instanciated per environment" or "always equal in all environments".
Related Content
- 9 months agoRichardPla
- 3 years agoaaronpliu