Forum Discussion

kristoffer's avatar
kristoffer
New Contributor
12 years ago

using property in a rest request

I'm trying to use a property value in a simple rest request in a test case in soapui 5.0.
1) I have defined a single test suite "TestMetaData" that contains a single test case "TestAvailableDates".
2) I've double-clicked this test-case and chose the Properties tab. I've added a property called "month" and given that a value of "7".
3) I then go to the REST request (which is a child node to "Test Steps (1)", which is a child node to the "TestAvailableDates" testcase.
4) In the table with all the parameters for the REST request i've pasted "${#AvailableDates#month}" into the "month" parameter value column.

When i run the test no value is sent in the "month" parameter.
What am i missing? after searching the web for a few hours i have unfortunately failed to find any examples or documentation of how to do this.

/Kristoffer

1 Reply

  • kristoffer's avatar
    kristoffer
    New Contributor
    So I found a workaround; or maybe i found the way "it's supposed to be done".

    I'm no longer trying to set the property on the REST request-step by pasting "${#AvailableDates#month}" as the value.
    Instead I inserted a Property Transfer step before the REST request-step where i chose the Test Case/Amount property as source, and the REST Request/Amount property as destination.

    Obviously i didn't spend much time with SoapUI yet and i get the feeling there's a lot more ways to set property values; and maybe there is no such thing as "the way it's supposed to be done".

    I still feel it would be intuitive to just paste "${#AvailableDates#month}" into the property value. And I also have the feeling it "kind of" worked the way i wanted it to first. You see, the request did not include the textual string "${#AvailableDates#month}" in the month argument; it was replaced with an empty string. So something did see that i wanted to resolve a value; however it only resolved to an empty string.

    Anyone have a clue if it could work the way i tried in the first post?