您的位置:首页 > 运维架构 > Shell

jmeter使用beanshell报错Typed variable declaration : Class: JSONObject not found in namespace

2020-07-31 12:07 966 查看

【问题描述】

jmeter使用beanshell断言报错:
2020-07-31 11:56:49,536 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of:

import org.json.*; String response = prev.getResponseDataAsString(); JSONObje . . . '' : Typed variable declaration : Class: JSONObject not found in namespace 2020-07-31 11:56:49,536 WARN o.a.j.a.BeanShellAssertion: Error in BeanShellAssertion org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval	Sourced file: inline evaluation of:
import org.json.*; String response = prev.getResponseDataAsString(); JSONObje . . . ‘’ : Typed variable declaration : Class: JSONObject not found in namespace
at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:180) ~[ApacheJMeter_core.jar:5.2.1]

【问题分析】

需要json.jar包

【解决方案】

1、下载json.jar包放到jmeter的lib目录下

2、重启jmeter

【验证】

再次执行OK,不需要在测试计划中引入json.jar包

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐