Forum Discussion
rohitgkk
13 years agoContributor
dmltn84 wrote:
I expanded script to look as follows, but it runs only once:def incrementValue = context.expand( '${Properties#incrementValue}' );
incrementValue = incrementValue.toInteger() + 1;
incrementValue = incrementValue.toString();
if (incrementValue <= 10) {
testRunner.testCase.setPropertyValue("incrementValue", incrementValue);
log.info "incrementValue: " + incrementValue;
testRunner.gotoStepByName("xxx");
}
Test steps are arranged in the following order:
1. Properties(1)
2. xxx
3. groovy script
Can you please advise what should be corrected?
It is running only once because your are setting the property value at the TestCase level and for condition check, you are accessing this from the test step i.e. Properties. So try the below
testRunner.testCase.getTestStepByName("Properties").setPropertyValue("incrementValue", incrementValue);
instead of testRunner.testCase.setPropertyValue("incrementValue", incrementValue);
Hope this helps.
Regards,
Rohit Shingalapur
http://www.developerscorner.co.cc
Related Content
Recent Discussions
- 5 days agoemoya