messageExchange...getPropertyValue( "propName") .. setPropertyValue( "propName", propValue) issue
It appears that, in a script assertion in a test step,
NOT a separate groovy script test step, if there is a
messageExchange.modelItem.testStep.testCase.getPropertyValue( "propName" )
and a
messageExchange.modelItem.testStep.testCase.setPropertyValue( "propName", propValue )
in the same test step script assertion, the setPropertyValue() always get executed 1st,
even if it comes AFTER the getPropertyValue() in the script.
Is this a bug or this this somehow by design?
For example, a script with just
log.info "Property value=" + messageExchange.modelItem.testStep.testCase.getPropertyValue( "propName" )
works as expected, it returns the current value of the property that can be viewed in the testCase properties list.
But script with:
def origPropValue = messageExchange.modelItem.testStep.testCase.getPropertyValue( "propName" )
log.info "Original property value=" + origPropValue
.... more processing to get a new value
messageExchange.modelItem.testStep.testCase.setPropertyValue( "propName", "some_new_Property_Value" )
newPropValue = messageExchange.modelItem.testStep.testCase.getPropertyValue( "propName" )
log.info "New property value=" + newPropValue
prints the new property value for BOTH origPropValue and newPropValue
even though origPropValue should be set and printed BEFORE the
new value for the property has been calculated and setPropertyValue() has run.
How does this happen????
How is origPropValue being overwritten?
Baffeling.
Thanks!