Forum Discussion
Yes, setup script at the test suite level is the one that suits your need.
Here is the script assuming that a COUNTER variable is being used in multiple test cases (one can have like ${#TestSuite#COUNTER} where required)
Similarly you may use for date
Here is the script assuming that a COUNTER variable is being used in multiple test cases (one can have like ${#TestSuite#COUNTER} where required)
//first get the value of the property
def currentCounterValue = testSuite.getPropertyValue('COUNTER')
//increment value by one if already has some value otherwise set it to 0
def counter = (currentCounterValue) ? (currentCounterValue as int) : 0
counter++
testSuite.setPropertyValue('COUNTER', counter.toString())
Similarly you may use for date
SuperSingh
7 years agoContributor
Hi nmrao
How do you set a new property in Setup Script at TestSuite level ?
say, I want to create a property "Counter" at Test Suite level via groovy. How do we do that?
I tried the following but it doesn't work.
testRunner.testSuite.setPropertyValue("Counter", "" )
Thanks,
SuperSingh