how to define variables in SOAPUI request

Originally posted by RaMup29 on December 04, 2017

I have a requirement for adding a variable to the SOAP request.

Below is the sample request.

IMSI123445 is the variable in the below request. how can i add the variable to SOAPUI?

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope
xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:urn=“urn:siemens:names:prov:gw:SPML:2:0”>
soapenv:Body
<spml:deleteRequest
xsi:schemaLocation=“urn:siemens:names:prov:gw:SPML:2:0 prov-gw-spml-2.0.xsd”
xmlns:spml=“urn:siemens:names:prov:gw:SPML:2:0”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
SUBSCRIBER_v51
Subscriber
IMSI123445
</spml:deleteRequest>
</soapenv:Body>
</soapenv:Envelope>

Originally posted by nmrao on December 05, 2017

You can add a test case level custom property, say ID and provide the required value.

In the request, use property expansion as shown below:

${#TestCase#ID}

In case if it needs to be dynamically generated, use groovy script and store the value at test case level.

Originally posted by RaMup29 on January 08, 2018

Hi Rao,

Can you pls help me define the custom properties. (Right-click on TestSteps → Add Step → Properties)

After Defining the cust properties like this, i used the string mentioned below, but it didnt work

Originally posted by RaMup29 on January 08, 2018

It worked Rao. Many Thanks for the help