I cannot seem to get past the BeanShellInterpreter whenever I try and use __FileToString built-in function in a BeanShell PreProcessor script. The FileContents variable does get populated, but the script fails and I cannot work with it. Here is the code and the error messages...
try {
Integer count=vars.get("SessionId").length()-5;
vars.put("vAuth", vars.get("v_username") + vars.get("SessionId").substring(count) + ":" );
log.info("Writing a info message");
${__FileToString(C:/tmp/DeltaConnectDemoTool_3_2_0S1_5515/bin/request.txt,,FileContents)};
log.info("Writing a second info message");
}
catch (Throwable ex ) {
log.error("Failed to do this or that", ex);
}
The Error is
2016/11/17 15:52:18 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of: ``try { Integer count=vars.get("SessionId").length()-5; vars.put("vAuth", vars.get . . . '' Encountered ":" at line 5, column 8.
2016/11/17 15:52:18 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval In file: inline evaluation of: ``try { Integer count=vars.get("SessionId").length()-5; vars.put("vAuth", vars.get . . . '' Encountered ":" at line 5, column 8.