I am working on a Beanshell preprocessor and I need to replace the values into my "String" to assign the parameter values (json format), I have this
String textToSign =
"{ \"origin\": \"${origin_encrypted}\"," +
" \"destiny\": \"${destiny_encrypted}\"," +
" \"subject\": \"${subject_encrypted}\"," +
" \"amount\": \"${amount_encrypted}\"," +
" \"softToken\": \"${softToken_encrypted}\" }";
log.info("Text To Sign: " + textToSign);
but i get Text To Sign: { "origin": "${origin_encrypted}", "destiny": "${destiny_encrypted}", "subject": "${subject_encrypted}", "amount": "${amount_encrypted}", "softToken": "${softToken_encrypted}" }
please help me :(
First of all you should reconsider using Beanshell, since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting.
Also Groovy provides more handy way to build JSON than string concatenation.
More information on Groovy scripting in JMeter: Apache Groovy: What Is Groovy Used For?