Hi,
I have a slightly different approach. There is nothing wrong with HimanshuTayal's approach, but in my tests, I tend not to use 'get property' or 'set property'. If I needed to create the value in one test and read in another test, then I probably would. However, my tests tend to be self-contained, so I use groovy scripts that 'return' the value of interest and then 'read' these in a later step in the same test.
For example, I need to supply a random number as an order number in some API request.
Firstly, I create a Groovy script to generate a random number. E.g.
Date date = new Date();
def now = date.getTime();
Random rnd = new Random();
rnd.setSeed(now);
return(rnd.nextInt(100));
note the use of return in the script. If I wanted to use Custom Properties, I'd set it instead of retuning.
In a later test step, I can then 'call' the random number groovy step to obtain the random value by using the below example...
<soapenv:Body>
<urn:submitOrder>
<urn:order>
<urn1:orderRef>${Get Random Number - Groovy Script#result}</urn1:orderRef>
<!-- Other details omitted -->
</urn:order>
</urn:submitOrder>
</soapenv:Body>