如图,想要获得多个多列数据,怎么把数据提取出出来,使用后置处理器BeanShell PostProcessor获取
jmeter使用BeanShell PostProcesso获取数据库多列数据

sql查询的结果是:

jmeter使用BeanShell PostProcesso获取数据库多列数据

然后在jdbc request右击,创建BeanShell PostProcessor,输入

var result=vars.getObject("result").get(0); //获取第一行的结果,值可根据自己的需要进行修改,result是第一张图设置的变量名称
vars.put("productId",result.get("id").toString());
vars.put("productVersion",result.get("product_version").toString());
vars.put("saleType",result.get("sale_type").toString());
vars.put("units",result.get("units").toString());
log.info("saleType"+vars.get("saleType"));

jmeter使用BeanShell PostProcesso获取数据库多列数据

最后就能获得对应的参数

相关文章:

  • 2022-12-23
  • 2021-10-30
  • 2021-09-11
  • 2021-06-19
  • 2021-11-05
  • 2021-07-05
  • 2021-06-27
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2022-01-10
  • 2021-05-01
  • 2021-04-14
  • 2022-12-23
  • 2021-11-22
相关资源
相似解决方案