asingh
12 years agoNew Contributor
How to use DataGen properties value within DataGen
Hi peeps,
I am trying to use a Datagen property within another Datagen property using Grovvy Script. But I am struggling. I do not have much knowledge on scripting.
I have a DataGen called DataGen TRXN which has properties as
QTY1 which is of Type Number and generates Random number
UP1 which is of Type Number and generates Random number
EV1 Which is of Type Script and should generate QTY1 * UP1
All I want is to extract the value of above properties and Multiply and generate EV1, So that the testcase can use QTY1, UP1 and EV1 concurrently.
I have used script as below
"def QTY1 = context.expand ('${Copy of DataGen TRXN#QTY1}')
def UP1 = context.expand ('${Copy of DataGen TRXN#UP1}')
EV1 = $($QTY1 * $UP1)"
Please help or suggest or enlighten me.
Thank you
Regards
Aalok
I am trying to use a Datagen property within another Datagen property using Grovvy Script. But I am struggling. I do not have much knowledge on scripting.
I have a DataGen called DataGen TRXN which has properties as
QTY1 which is of Type Number and generates Random number
UP1 which is of Type Number and generates Random number
EV1 Which is of Type Script and should generate QTY1 * UP1
All I want is to extract the value of above properties and Multiply and generate EV1, So that the testcase can use QTY1, UP1 and EV1 concurrently.
I have used script as below


"def QTY1 = context.expand ('${Copy of DataGen TRXN#QTY1}')
def UP1 = context.expand ('${Copy of DataGen TRXN#UP1}')
EV1 = $($QTY1 * $UP1)"
Please help or suggest or enlighten me.
Thank you

Regards
Aalok