I would like to have a global variable, to be used in all of my tests, hence I configured in: citrus-context.xml the following:
<citrus:global-variables>
<citrus:variable name="myVariableName" value="citrus:randomNumber(3)"/>
</citrus:global-variables>
This seems to work, but the generated variable is changed to a new random number, everytime I refer to this variable.
${myVariableName} ${myVariableName} ${myVariableName}
835 165 516
What is the preferred way to generate a random number to be used in all tests?
I solved this on my own, by implementing a BeforeSuite. Thanks to this post here: How should i pass variable extracted From Payload thru test classes? So, this is how I did this: