Forum Discussion
SmartBear_Suppo
15 years agoSmartBear Alumni (Retired)
Hello,
The easiest way to do this would be to have a separate Groovy TestStep before the actual request where you set these as Test Properties in for example the TestCase. For instance:
And then in your request use the property expansions as follows:
You will need to first create the two Test Properties in the TestCase for this to work.
Regards,
Dain
eviware.com
The easiest way to do this would be to have a separate Groovy TestStep before the actual request where you set these as Test Properties in for example the TestCase. For instance:
def crsNum = (int)(1 + Math.random()*4)
def studage = (int)(crsNum*10 + Math.random()*10)
testRunner.testCase.properties['crsNum'].setValue( (String)crsNum )
testRunner.testCase.properties['StudAge'].setValue( (String)studage )
And then in your request use the property expansions as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ejb="http://EJBcourse.sun.com/">
<soapenv:Header/>
<soapenv:Body>
<ejb:checkAgeFull>
<crsNum>${#TestCase#crsNum}</crsNum>
<StudAge>${#TestCase#StudAge}</StudAge>
</ejb:checkAgeFull>
</soapenv:Body>
</soapenv:Envelope>
You will need to first create the two Test Properties in the TestCase for this to work.
Regards,
Dain
eviware.com
Related Content
- 9 months agoRichardPla
- 3 years agoaaronpliu