0
votes

In Jmeter, I can able to extract the value using regular expression extractor, but while parsing the value I need some changes in the value as below.

Example, Suppose If I extract this value in regular expression extractor (single Value in multiple lines), PHNhbW+xwO U0FNTDoyL cmFjbGUu+

Here I Need to replace + by %2B, need to add %OD%OA at the end of each line and multiple lines to a single line as below.

PHNhbW%2BxwO%OD%OAU0FNTDoyL%OD%OAcmFjbGUu%2B%OD%OA

I need to parse this as a single parameter value.

1

1 Answers

0
votes

I think you can use __javaScript() function which allows calling arbitrary JavaScript code and inside JMeter __javaScript() funciton you can call EcmaScript EncodeURIComponent() function

It will automatically convert all newline characters \r\n to %OD%OA and + to %2B and in fact any character except alphanumeric and these ones:

_ . ! ~ * ' ( )

Demo:

JMeter JavaScript

See Using JMeter Functions guide for comprehensive information on how to deal with the functions in JMeter