Forum Discussion
2 Replies
- hicksNew Contributor
Now I'm adding a time stamp, but this is not exactly what we need.
String generateUsername(String user) { date = new Date().format('MMddyy-HHmmss') user = user + "+" + date + "@test.com" } user = generateUsername("qatester") testRunner.testCase.setPropertyValue( "email", user ) log.info user- nmraoCommunity Hero
Here you go:
1. Set initial value to a variable at test case level, say counter = 0.
2. Read variable test case variable count using getPropertyValue or context.expand('${#TestCase#counter}'), parset it as int, increment by one in the script you have.
3. Do stuff what you wanted to do here // say, concatenate to another variable..
4. Now set the updated counter back to property as string.
You are done.