6

I need to transfer some values from previous test steps into a query parameter that is a list on the next test step. I am using SoapUI Pro 5.

Example:

I call addCustomer twice and get two IDs for the new customers, say ID=111 and ID=222. I then call a getCustomer method which has a query parameter which is a list of IDs. These are REST methods and the getCustomer URL looks like this:

GET http://myEndpoint.com/customers?ids=111&ids=222

How do I transfer the two IDs from the previous steps into the IDs list of getCustomer? Property Transfer seems to overwrite it and only puts the last ID in the list.

GeekChick
  • 118
  • 1
  • 2
  • 10
  • Property transfer should work, as well as many other methods. Can you show more of the property transfer you are using? – nwill001 Jun 11 '14 at 16:27
  • @nwill001 - My test steps look like this: 1. call addCustomer 2. call addCustomer 3. property transfer 4. call getCustomer. In the property transfer, I create two transfers. The first transfers the customerId from the first addCustomer response to the ids parameter in getCustomer. The second transfer transfers the customerId from the second addCustomer response to the ids parameter in getCustomer. When I run the test suite, getCustomer is called only using the second customerId. – GeekChick Jun 11 '14 at 18:13
  • There is a new relevant answer that is more up to date than the accepted anwer. Would you be willing to look at it and consider choosing it as the accepted answer? – Preza8 Aug 15 '19 at 14:53
  • 1
    @Preza8 - thanks, I no longer use SoapUI but I trust you are correct and changed the accepted answer :) – GeekChick Aug 16 '19 at 22:35

2 Answers2

17

In the Request Properties, go to Multiple-Value Delimiter and set one value, lets say comma, then in the actual value you can put comma separeted the values.

In our case ids=111,222 will be transtaled to ids=111&ids=222

Tuna
  • 2,937
  • 4
  • 37
  • 61
Miguel Nieto
  • 206
  • 2
  • 3
  • 4
    This is the real current answer now that the limitation has been addressed since the previous answer was given. – Keith Tyler Jan 16 '17 at 23:58
7

SoapUI currently has a known issue ("defect"?) in that it will not allow you to supply same named parameter multiple times, such as ids=111&ids=222 in your example. In their jira tracking system, it is SOAPUI-4646.

The workaround is ... not pretty.

In your endpoint, where the methods is defined, select the parameter and turn on "Disable Encoding". Then in your call, for the parameter ids, you would provide the literal value: 111&ids=222. In order to make this dynamic, you would probably have to resort to Groovy scripting.

SiKing
  • 10,003
  • 10
  • 39
  • 90
  • Thank you! I used Groovy to extract the values from the response of the first two test steps, build the literal string as you suggested, and inserted it into the request of the last test step. And of course I had to check Disable Encoding. – GeekChick Jun 11 '14 at 22:51
  • If interested, I found a way to handle this through events. Discussion here: http://siking.wordpress.com/2014/09/02/dynamic-query-parameters-in-soapui/ – SiKing Oct 02 '14 at 14:54