Forum Discussion

moofatech's avatar
moofatech
New Contributor
7 years ago

How can I duplicate parameters?

Hi there,


I'm not sure this has been raised before but I thought I'd ask anyway.

I'm trying to run a GET request that represents a filter that can have two or more values passed to it. The url in the request is something like this:

https://nonexistingendpoint.com/v1/findNames?name=A&name=B

The above is a valid URL but it is not accepted in SoapUI. (the software actually crashed when I attempted to force it using 'New Resource').

What would be a great alternative?

 

Thanks for the help.

  • PaulMS's avatar
    PaulMS
    Super Contributor

    This answer should work

     

    https://community.smartbear.com/t5/SoapUI-Pro/Res-duplicate-properties-in-REST-request/td-p/39318

     

    To summarize:
    - in Resource or in Method, add parameter (use style = QUERY)
    - select parameter and enable "Disable Encoding" at bottom of page
    - in Request, select parameter and set Multi-Value Delimiter to \| in bottom-left properties section
    - set a value of, e.g., 1|2|3 for the parameter (can use DataGen)
    - request will be sent out with, e.g., parameter=1&parameter=2&parameter=3

     

    • moofatech's avatar
      moofatech
      New Contributor

      This worked fine for me. Thank you for your help :smileyvery-happy:.

    • socaltester's avatar
      socaltester
      Contributor

      I attempted to follow the above solution provided and got stuck after being able create the second duplicate parameter I needed. Basically, I created the non-entitized parameter (param 1) that is to be entitized and created duplicate parameter (param 2) as entitized with "disable encoding" enabled, but creating a third duplicate parameter or more is failing due to SoapUI's insistance of unique paramater names.

       

      https://nonexistingendpoint.com/v1/findNames?name=A&name=B&name=C&name=D

       

      Can someone help? Am I missing something in the summary of steps? For instance, do I need to create a data generator after the entitized and non-entitized options are exhausted?