scottkib
11 years agoOccasional Contributor
Groovy scripting help
Hi all,
I'm new to groovy, and looking for a way to set property values within a loop in my tear down script. If I run the set and get outside of the loop, I have no problems. If I move the code within the loop my script log stops on the first iteration at
log.info step.getName() + " : " + res.getStatus()
My code is below, and
stepResults = testRunner.getResults()
testStepCount = testRunner.testCase.getTestStepCount()
status = new Object[testStepCount]
count = 0
for(res in stepResults)
{
step = res.getTestStep()
log.info step.getName() + " : " + res.getStatus()
status[count] = res.getStatus()
testRunner.testCase.setPropertyValue("StepStatus"+count, status[count])
log.info testRunner.testCase.getPropertyValue("StepStatus"+count)
count++
}