Ask a Question

How to disable URL encoding via groovy script?

MrGcube
Occasional Visitor

How to disable URL encoding via groovy script?

We are executing test cases in which we would like to pass special characters in our URLs to make sure our endpoints handle these scenarios gracefully.

 

We currently set the URL for each request as below, where requestData.getUrl() returns a URL with special characters in its endpoint:

// Set the endpoint
testStep.setPropertyValue("endpoint", requestData.getUrl())

 

The URL set would take the form of something similar to this: 

<hidden_base_url>/resourcepath/abc$£12/morepath

 

When making the request, we can see that SOAPUI is URL encoding the endpoint, so the request ends up looking more like this:

<hidden_base_url>/resourcepath/abc$%C2%A312/morepath

 

Is it possible via groovy scripting to disable URL encoding for this test request?

1 REPLY 1
PaulMS
Super Contributor

It is possible to disable encoding of a template parameter value if you separate that resource path from the endpoint.

However Soap UI did not handle a test request when there was a $ symbol in the template parameter value and disable encoding. That might be a defect to avoid.

 

https://www.soapui.org/rest-testing/understanding-rest-parameters.html

https://www.soapui.org/rest-testing/rest-resources-and-methods.html

For custom encoding handling when setting a parameter value (the “Disable Encoding” setting)

cancel
Showing results for 
Search instead for 
Did you mean: