Forum Discussion
groovyguy
8 years agoCommunity Hero
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"); }
zorglups
6 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.
- Radford6 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.
- zorglups6 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".