Ask a Question

How can I duplicate parameters?

SOLVED
moofatech
New Contributor

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.

7 REPLIES 7
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

 

This worked fine for me. Thank you for your help Smiley Very Happy.

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?

Can anyone respond? In order to attempt creating a third and fourth duplicate I am replacing a property character with an HTML Hex Code.

 

https://nonexistingendpoint.com/v1/findNames?name=A&name=B&n%61me=C&n%61%6De=D

 

Yes....

Entitize Properties is " false "

Multi-Value Delimiter is " \| "

Disable Encoding is selected "Disables URL-Encoding of the parameter value

 

But...

the approved solution in this post indicates that characters shouldn't need to be entitized/encoded

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

 

Hey @socaltester

I havent got my laptop so i cant try and reproduce to nail this down but ive used these instructions to do this before.


Are you remembering to set the multi-value delimiter switch in the Request Properties section (bottom left hand corner) to \|

Also then you need to input the different name parameter values (e.g. A,B,C,D) in the Name query parameter 'Value' field ensuring to separate the values using the |

e.g. A|B|C|D

Once you do this you should then see the repeated name query parm string (e.g. ?name=A&name=B&name=C&name=D ) displayed within the 'Parameters' field (adjacent to thr 'Resource' field

Nice one,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

I made a mistake by using the example used by the previous poster as I now understand the use of the " | " delimiter when duplicate properties are in back-to-back order.  My actual situation has over 150+ properties and the duplicate properties are never back-to-back within the urlencoded string. Instead there are many properties in between each duplicate, such as, this example segment...

 

&COLOR%2FWRAP=&COLOR%2FCOLOR_NAME=&COLOR%2FCC=&COLOR%2FNUM=&COLOR%2FBOX=&COLOR%2FSOURCE=&COLOR%2FCARGO=&COLOR%2FWRAP=&COLOR%2FCOLOR_NAME=&COLOR%2FCC=&COLOR%2FNUM=&COLOR%2FBOX=&COLOR%2FSOURCE=&COLOR%2FCARGO=&COLOR%2FWRAP=&COLOR%2FCOLOR_NAME=&COLOR%2FCC=&COLOR%2FNUM=&COLOR%2FBOX=&COLOR%2FSOURCE=&COLOR%2FCARGO=&COLOR%2FWRAP=&COLOR%2FCOLOR_NAME=&COLOR%2FCC=&COLOR%2FNUM=&COLOR%2FBOX=&COLOR%2FSOURCE=&COLOR%2FCARGO=&WRAP

 

 

 

 

 

 

 

I'll create a new post.

cancel
Showing results for 
Search instead for 
Did you mean: