为啥在jmeter中导入一个包,然后在测试计划中也定义了包的具体位置;但是在BeanShell PostProcessor中import仍然找不到?
找了好久各种办法都试过了,仍然报错,提示找不到相应的包和方法,求大神详解
错误如下:
2019/03/14 10:36:33 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import . . . '' : Typed variable declaration : Method Invocation JSON.parseObject 2019/03/14 10:36:33 WARN - jmeter.extractor.BeanShellPostProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of:
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import . . . ‘’ : Typed variable declaration : Method Invocation JSON.parseObject ##
报错代码如下:
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
String response_data = prev.getResponseDataAsString(); // //获取url返回的串的所有内容
JSONObject data_obj = JSON.parseObject(response_data);
String json=data_obj.get(“data”).toString();
JSONObject jso=JSON.parseObject(json);//json字符串转换成jsonobject对象
JSONArray jsarr=jso.getJSONArray(“dailyDeliveryGoodsDtos”);//jsonobject对象取得数组,具体到某种类型的商品信息
String str2=“”;