Forum Discussion
TommyTester
Occasional Contributor
Sure, this is the Load Script:
Date date = new Date()
String newDateTime = date.format("yyyy-MM-dd'T'HH:mm:ss.SSS")
project.setPropertyValue("Timestamp", newDateTime)
nmrao
8 years agoChampion Level 3
This seems to be ok. Where do you experience the issue?
- TommyTester8 years agoOccasional Contributor
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
- groovyguy8 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"); }- zorglups6 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.
Related Content
- 4 years ago
Recent Discussions
- 15 hours ago