Я использую JSR223 Sampler и пытаюсь выполнить арифметические операции ..
try {
setStrictJava(true);
int a=1;
int b=2;
int c = a+b;
vars.put("c",c);
} catch(Exception ex) {
log.error("something wrong", ex);
throw ex;
}
Получение следующей ошибки ..
2018-12-18 18:19:59,554 ERROR o.a.j.p.j.s.JSR223Sampler: Problem in JSR223 script JSR223 Sampler, message: javax.script.ScriptException: Sourced file: inline evaluation of: ``try{ setStrictJava(true); int a=1; int b=2; int c = a+b; vars.put("c",c); } catc . . . '' : Error in method invocation: Method put( java.lang.String, int ) not found in class'org.apache.jmeter.threads.JMeterVariables' : at Line: 6 : in file: inline evaluation of: ``try{ setStrictJava(true); int a=1; int b=2; int c = a+b; vars.put("c",c); } catc . . . '' : vars .put ( "c" , c )
in inline evaluation of: ``try{ setStrictJava(true); int a=1; int b=2; int c = a+b; vars.put("c",c); } catc . . . '' at line number 6
javax.script.ScriptException: Sourced file: inline evaluation of: ``try{ setStrictJava(true); int a=1; int b=2; int c = a+b; vars.put("c",c); } catc . . . '' : Error in method invocation: Method put( java.lang.String, int ) not found in class'org.apache.jmeter.threads.JMeterVariables' : at Line: 6 : in file: inline evaluation of: ``try{ setStrictJava(true); int a=1; int b=2; int c = a+b; vars.put("c",c); } catc . . . '' : vars .put ( "c" , c )
Как решить эту проблему?