测试积点老人 发表于 2019-8-19 09:44:17

Jmeter 中 BeanShell PostProcessor 使用 props.put 设置全局属性报错

beanshell代码
String id=vars.get("pfid");
String ack=vars.get("access_token");
// vars.get("access_token")

vars.put("access_token",ack);

vars.put("pfid", id);
props.put("access_token",ack);
props.put("pfid", id));
报错内容
ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String id=vars.get("pfid"); String ack=vars.get("access_token"); // vars.get("ac . . . '' : Method Invocation props.put

WARN o.a.j.e.BeanShellPostProcessor: Problem in BeanShell script: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String id=vars.get("pfid"); String ack=vars.get("access_token"); // vars.get("ac . . . '' : Method Invocation props.put

ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of: ``String id=vars.get("pfid"); String ack=vars.get("access_token"); // vars.get("ac . . . '' Encountered ")" at line 9, column 22.

qqq911 发表于 2019-8-20 10:34:32

方法错了

jingzizx 发表于 2019-8-20 12:32:24

看看方法用的对不对

清晨一缕阳光 发表于 2019-8-20 16:45:30

最后一行代码多了一个括号
页: [1]
查看完整版本: Jmeter 中 BeanShell PostProcessor 使用 props.put 设置全局属性报错