BeanShell Script
" s " "y"= s.equals (y); Vars.put ("result2 ", result);
By looking at the result tree, BeanShell the foot of the newspaper wrong
By Youdao Translator, means the method call error
Which method calls the error?
Error in method invocation by exception Discovery: method Put (java.lang.String, Boolean) not found in class ' org.apache.jmeter.t Hreads. Jmetervariables '
There should be no way to find the put (Java.lang.String, Boolean).
The bold guess is that the put value should be string. Validation conjecture:
Modify the code as follows:
" s " "y"= s.equals (y); Vars.put ("result " , result.tostring ()); Type is converted to string
int I=integer.parseint (a); string-to-integer //vars.put ("result2", result); System. out. println (VARs.Get("result"));
Because the SYSTEM.OUT.PRINTLN statement is used for printing, the cmd window displays debug information
By Youdao Translator, means the method call error
Expand the knowledge point:
String s ="s"; String y="y"; Boolean result=s.equals (y); Vars.put ("result", result.tostring ());//vars.put ("result2", result);Log.info ("Agoly"); Write the log information to the Jmeter.log file to system. out. println (VARs.Get("result")); Log.info ("The result of RESULT1 is"+vars.Get("result")); Log.info ("The result of RESULT2 is"+result);
JMeter in BeanShell sampler debug sharing