Forum Discussion

AdiSoap123's avatar
AdiSoap123
Occasional Contributor
13 years ago

Storing returned values in variables

Hi,

Is it possible to store a value which has been returned by a webservice in a variable and use that value as an input for a further test case?

For example my first test test case gives a return value of <TransactionId>12345</TransactionId> and I store this in MyVar.

Then I have a seperate test case which returns the details of the transaction id 12345 by referencing it as <TransactionId>MyVar</TransactionId>.

Hopefully this is clear.

Thanks

4 Replies

  • AdiSoap123's avatar
    AdiSoap123
    Occasional Contributor
    Looks like what I am looking for is properties. http://www.soapui.org/Getting-Started/1 ... rties.html.

    It says "Both are extremely simple to do in SoapUI Pro and a little harder in the Open Source version, but it doesn’t matter; learn how to do it!". Can anybody point me to some documentation on how to do this with the Open Source version?
  • AdiSoap123's avatar
    AdiSoap123
    Occasional Contributor
    I am having a problem with this now. I have one example which is working, and another example which is almost identical which is not working.

    I have set up the failing test like this

    Test Step 1. Make a request which returns a result
    Test Step 2. Created a property transfer to transfer the property
    Test Step 3. Use the property to send another request

    When I run the test case (i.e. all the steps), steps 1 and 2 pass but no xml is returned for step 3, same as if no parameter was passed to it. The strange things is I can see the parameter populated in the correct position in the step 3 outgoing xml, and if I run test step 3 individually (not running the entire test case) it works fine and the expected data is returned.

    Anybody experienced anything like this?
  • AdiSoap123's avatar
    AdiSoap123
    Occasional Contributor
    OK figured this one out too, the step actually takes 10 seconds to complete so when step 3 receives the property and sends the request the initial process is still working hence the unexpected result.

    Added a time delay and works great now.