Forum Discussion
rupert_anderson
9 years agoValued Contributor
Hi,
Is it that for each execution of a TestCase you want to generate 1 random id and use it across more than one TestStep?
If so, in your TestCase:
1) Insert a Groovy TestStep as the first TestStep
2) in the Groovy TestStep generate a random number and store it in a property in the TestCase's context variable e.g.
context["randomId"]=random number code
3) You can than use the generated randomId property multiple times(in that execution of the TestCase) without its value changing. Use the property expansion syntax to reference itin requests etc e.g.
${randomId}
Make sense?
Regards,
Rupert
Related Content
- 5 years ago
Recent Discussions
- 2 days ago
- 2 days ago