How to I set the value of a test case property from a groovy script
I have a working groovy script that adds 1 day onto a date stored in a property called 'quoteexpirydate'... the script works fine and I can see the result in the log.info window. My question is, how do I set the value of another property 'quoteexpirydate_plus' so I can use this in my next REST request message. Here is my existing Groovy script:
use(groovy.time.TimeCategory) {
def quoteexpirydate = context.expand ( '${#TestCase#quoteexpirydate}' )
def formated_quoteexpirydate = Date.parse("yyyy-MM-dd", quoteexpirydate)
def onedayfromexpirydate = formated_quoteexpirydate + 1.day
log.info onedayfromexpirydate.format("yyyy-MM-dd")
}
Hi,
testRunner.testCase.getTestStepByName.setPropertyValue("quoteexpirydate_plus", yourVariableForThis)
I hope this helps