I have response data captured in a variable in regular expression extractor like

SAMLResponse" value="PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6
cHJvdG9jb2wiIElEPSJzMmYx ...

In the subsequent request it goes as :

SAMLResponse="PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6%0D%0AcHJvdG9jb2wiIElEPSJzMmYx ..

I have to replace 
 by %0D%0A

upvote
  flag
I tried disabling the encoding option too but it didn't work. Can someone help me? – Abhishek Kumar

1 Answers 11

You can use the combination of the following JMeter Functions:

  • __unescapeHtml() - to convert these 
 Unicode symbols into "normal" line breaks
  • __urlEncode() - to convert line breaks into URL-escaped codes

Assuming you have JMeter Variable reference name foo you will need to combine these functions like:

${__urlencode(${__unescapeHtml(${foo})})}

Demo:

JMeter Functions Demo

Check out Apache JMeter Functions - An Introduction article to get familiarized with the JMeter Functions concept.

upvote
  flag
Thanks a lot Dmitri... it's working now. – Abhishek Kumar

Not the answer you're looking for? Browse other questions tagged or ask your own question.