Hi,
Add a Sampler JSR223 before your http sampler and select javascript language
In this sampler the javascript code :
var sContact = '${OTAId}' + '${OTAPwd} ' + '"StartDate":' + '"${Start_Date}"' + ',' + '"EndDate":' + '"${End_Date}"';
log.info("sContact = " + sContact);
vars.put("P_CONTACT",sContact);
var sMD5= "${__MD5(${P_CONTACT},P_MD5)}";
log.info("sMD5 = " + sMD5);
var sBase64 = "${__base64Encode(${P_MD5},P_ENCODED_CONTACT_B64)}";
log.info("sBase64 = " + sBase64);
log.info("P_ENCODED_CONTACT_B64 = " + vars.get("P_ENCODED_CONTACT_B64"));
// for verify the encoded result not mandatory
var sBase64Decoded = "${__base64Decode(${P_ENCODED_CONTACT_B64},P_DECODED_CONTACT_B64)}";
log.info("P_DECODED_CONTACT_B64 = " + vars.get("P_DECODED_CONTACT_B64"));
==============================================================
Use the ${P_ENCODED_CONTACT_B64} in your http sampler in the JSON
Logs :
2016/01/13 16:51:57 INFO - jmeter.protocol.java.sampler.JSR223Sampler: sContact = 1234thepasswordOTA "StartDate":"20160110","EndDate":"20160113"
2016/01/13 16:51:57 INFO - jmeter.protocol.java.sampler.JSR223Sampler: sMD5 = f074b1bce39f8a0126809bb243966d0e
2016/01/13 16:51:57 INFO - jmeter.protocol.java.sampler.JSR223Sampler: sBase64 = ZjA3NGIxYmNlMzlmOGEwMTI2ODA5YmIyNDM5NjZkMGU=
2016/01/13 16:51:57 INFO - jmeter.protocol.java.sampler.JSR223Sampler: P_ENCODED_CONTACT_B64 = ZjA3NGIxYmNlMzlmOGEwMTI2ODA5YmIyNDM5NjZkMGU=
2016/01/13 16:51:57 INFO - jmeter.protocol.java.sampler.JSR223Sampler: P_DECODED_CONTACT_B64 = f074b1bce39f8a0126809bb243966d0e
and result in a Debugg sampler :
JMeterVariables:
End_Date=20160113
JMeterThread.last_sample_ok=true
JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@2f673724
OTAId=1234
OTAPwd=thepasswordOTA
P_CONTACT=1234thepasswordOTA "StartDate":"20160110","EndDate":"20160113"
P_DECODED_CONTACT_B64=f074b1bce39f8a0126809bb243966d0e
P_ENCODED_CONTACT_B64=ZjA3NGIxYmNlMzlmOGEwMTI2ODA5YmIyNDM5NjZkMGU=
P_MD5=f074b1bce39f8a0126809bb243966d0e
START.HMS=150930
START.MS=1452694170430
START.YMD=20160113
Start_Date=20160110
TESTSTART.MS=1452700316929
Regards.
Vincent D.