添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
问题 利用jmeter JDBC Request 请求,BeanShell 后置处理程序提取数据库中的值,页面报错:

Error invoking bsh method: eval Sourced file: inline evaluation of: ``//import java.util.Date; String code1 =
image 801×538 11.1 KB image 851×143 6.14 KB

日志打印结果如下:

2023-12-13 10:10:10,411 INFO o.a.j.u.BeanShellTestElement: ============打印INFO级别的日志===================
2023-12-13 10:10:10,411 INFO o.a.j.u.BeanShellTestElement: ********************在BeanShell设置的局部变量msg_1的值为:BJD-20231213005199
2023-12-13 10:10:10,412 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: //import java.util.Date; String code1 = vars.getObject("result").get(0).get("cod . . . '' : Typed variable declaration 2023-12-13 10:10:10,412 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: //import java.util.Date; String code1 = vars.getObject(“result”).get(0).get("cod . . . ‘’ : Typed variable declaration
2023-12-13 10:10:10,412 DEBUG o.a.j.c.GenericController: Calling next on: class org.apache.jmeter.control.GenericController
2023-12-13 10:10:10,412 DEBUG o.a.j.t.TestBeanHelper: Preparing class org.apache.jmeter.sampler.DebugSampler
2023-12-13 10:10:10,412 DEBUG o.a.j.t.TestBeanHelper: Setting displayJMeterProperties=false

test环境

image 1100×627 13.8 KB JDBC Request 查询的结果变量设置为result,利用BeanShell 从result 返回值提取code,create_time,目前报错中我只提取聊code,出现问题,不知道怎么解决,求老师给一个解决BeanShell 代码,
我最终要的结果是JDBC Request 返回的code,create_time,作为下一个接口的请求参数