Forum Discussion
M_McDonald
16 years agoSuper Contributor
You can embed simple Groovy scripts in the body of Request steps, eg.
or for more complex code, create a DataGen step with a script property and use an expansion referencing that in the Request:
${=if ('${TestCase#employeeName}'=='eric')
return """<Employeename>employeename1 value</Employeename>
<CompanyName>companyname1 value</CompanyName>
<CompanyAdress>company address1 value</CompanyAddress>"""
else return ""<CompanyAdress>company address2 value</CompanyAddress>"""
}or for more complex code, create a DataGen step with a script property and use an expansion referencing that in the Request:
${DataGen#request}