Trying to decode % character in a parameter value JMeter fails with IllegalArgumentException: URLDecoder: Illegal hex characters in escape(%) pattern

StackOverflow https://stackoverflow.com/questions/12428421

Question

Using Apache JMeter 2.7, the message body (JSON) for my POST request contains a password field which is in the form asdf%xy3dsfsfsf. JMeter is trying to interpret %xy as percent encoded character and throwing this exception.

Uncaught Exception java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape(%) pattern - For input string: "xy". See log file for details.

I cannot escape the character using backslash asdf\%xy3dsfsfsf since it would get to the webservice as the incorrect password.

Please advice on how to resolve this issue.

UPDATE: The issue is resolved in build 2578. https://builds.apache.org/job/JMeter-trunk/2578/

Was it helpful?

Solution

You can try checking encode checkbox on the parameter in Parameters Tab as you value contains special char %.

From reference about Send Parameters With the Request:

Additionally, you can specify whether each parameter should be URL encoded. If you are not sure what this means, it is probably best to select it. If your values contain characters such as & or spaces, or question marks, then encoding is usually required.

See also:

Finally, can you confirm you get the exception when clicking HTTP Request in View Results Tree, I've raised a bug to improve this behaviour anyway which has been fixed:

Maybe you could try the nightly build which will is now available and give some feedback, see instructions for using it here:

Regards

Philippe M.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top