Thomas
Thomas

Reputation: 237

SoapUI create a template SOAP request - reuse in testcases

I am new to SoapUI. I am trying to do the following in SoapUI but don't know where to start: 1. Create a XML file with the content of a SOAP request 2. Reuse the file created in step 1 as template in other testcases

Thanks,

Upvotes: 2

Views: 2696

Answers (2)

Ajay
Ajay

Reputation: 1

  1. You can also store content in an xml file.
  2. The file can be read through a groovy script and the content in the file can be assigned to the Test variable of the test case.
  3. The custom variable can be referred as ${#TestCase#templateData} in the XML request

Please remember that templateData should be the name of the custom variable of the test case.

Upvotes: 0

Thomas
Thomas

Reputation: 237

I have found a way to achieve this:

  1. Create the content of the template xml into a property file as Name/Value pairs

  2. In the request, use the property(s) at appropriate place using the syntax "${#PROPERTY_NAME}"

  3. In the setup script, load the property file

Upvotes: 1

Related Questions