I am using a Regex Extractor to get a URL for the next step in the test plan.
The Url will change whether the request was successful or not. Here is an
example:
{"success":true,"successUrl":"/checkout/thankyou?email=77220130305125322mg07gkqup3%40blah.com\u0026order_number=541682470"}
I am extracting the URL correctly using
successUrl":"(.*?)"
However, when I try to use it in the next sampler, I get an error. Example:
https://server.test.com/checkout/thankyou?email=77220130305125322mg07gkqup3%40nook.com\u0026order_number=541682470
The error is
java.net.URISyntaxException: Illegal character in query at index 85:
https://uk.pe.nook.com/checkout/thankyou?email=77220130305125322mg07gkqup3%40nook.com\u0026order_number=541682470
I believe this is due to the JSON response which converted '&' to "\u0026" in
the URL.
What's the best way to handle this? Do I need to use a Beanshell Preprocessor
to substitute "\u0026" back to '&' ?