# how to define variables in SOAPUI request

**URL:** <https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169>\
**Category:** SoapUI OS\
**Tags:** api, soapui, migrated\
**Created:** [December 5, 2017, 1:07am UTC](https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169 "2017-12-05T01:07:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [December 5, 2017, 1:07am UTC](https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169/1 "2017-12-05T01:07:14Z")

</div>

> 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/](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](http://www.w3.org/2001/XMLSchema-instance)”\>  
SUBSCRIBER\_v51  
Subscriber  
IMSI123445  
\</spml:deleteRequest\>  
\</soapenv:Body\>  
\</soapenv:Envelope\>

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [December 5, 2017, 8:03am UTC](https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169/2 "2017-12-05T08:03:12Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 9, 2018, 5:16am UTC](https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169/3 "2018-01-09T05:16:43Z")

</div>

> 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)

 ![Cust_proper.png](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/4afbf44a81bd57865b8f5c43f290bd433187b2e3.png)

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

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 9, 2018, 5:30am UTC](https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169/4 "2018-01-09T05:30:50Z")

</div>

> Originally posted by **RaMup29** on January 08, 2018

It worked Rao. Many Thanks for the help

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:12pm UTC](https://community.smartbear.com/t/how-to-define-variables-in-soapui-request/169/5 "2026-10-07T17:12:45Z")

</div>

Closed on October 7, 2026, 5:12pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
