Forum Discussion
nmrao
Champion Level 3
Can you show the relevant script that you are talking about for review?
TommyTester
7 years agoOccasional 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)
- nmrao7 years agoChampion Level 3This seems to be ok. Where do you experience the issue?
- TommyTester7 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
- groovyguy7 years agoChampion Level 1
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"); }
Related Content
- 9 months agoRichardPla
- 3 years agoaaronpliu