Jmeter 編寫beanshell腳本中異常
ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval null
WARN o.a.j.e.BeanShellPostProcessor: Problem in BeanShell script: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval null
WARN o.a.j.a.BeanShellAssertion: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval
In file: inline evaluation of: '' Encountered "=" at line 11, column 17.
以上錯誤是由於腳本方法中引用了無效變量
後來才發現了Script(see below for variables that are defined)
我理解的就是beanshell腳本中的變量只引用的對象一定是已經定義過的,不能自己在腳本中new 新對象
但是
String testCity = (String)vars.getObject("testCity");
String[] status = testCity.split(",");
int size = status.length;
這樣是可以的