Forum Discussion

shaialo's avatar
shaialo
New Contributor
9 years ago
Solved

how to transfer property from REST GET request to another REST POST request

Hi there,

I need help on SoapUI NG Pro (I couldn't find any demo or Youtube video explaining this) :

How can I transfer properties from a REST GET request to REST POST request, when:

The properies I get from the REST GET request is in the form of XML and I can get the properties as:

1. //html[1]/body[1]/div[1]/form[1]/input[@id="__EVENTVALIDATION"]/@value

2. //html[1]/body[1]/div[1]/form[1]/input[@id="__VIEWSTATE"]/@value

 

Those 2 properties I need to transfer to a REST POST request, but it needs to be in the body of the request, concatenated to other constant properties.

 

How can I do that?
Thanks!!

  • You can use property expansion for the same.
    Save them at test case level properties and use in the post resquest
    "name" : "${#TestCase#PropertyName}"
  • What I was missing is how to setup the properties in the first place, like:

    1. Go to the desired node in the XML response representation,

    2. Right-click on the node's value, select: "Transfer to" => "Add property step"

    3. Create the property right - set Target to the Property name.

    4. Then, in the POST request: right-click on the insert location => "Ge Data" => Project[X] => Property[Y].

     

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You can use property expansion for the same.
    Save them at test case level properties and use in the post resquest
    "name" : "${#TestCase#PropertyName}"
    • shaialo's avatar
      shaialo
      New Contributor

      What I was missing is how to setup the properties in the first place, like:

      1. Go to the desired node in the XML response representation,

      2. Right-click on the node's value, select: "Transfer to" => "Add property step"

      3. Create the property right - set Target to the Property name.

      4. Then, in the POST request: right-click on the insert location => "Ge Data" => Project[X] => Property[Y].