Jmeter的BeanShell PostProcessor使用_提取list参数并存至文件

今天介绍下Jmeter的BeanShell PostProcessor使用。

      BeanShellPostProcessor 是一个轻量级的面向Java的脚本语言,借用了JMeter对于BeanShell支持的特性,允许使用标准的Java语法来处理Json数据,普通变量数据,并可进行逻辑处理。
    以下介绍在jmeter中使用BeanShellPostProcessor用来提取参数数据并存至文件。

操作步骤:

1、需要使用BeanShellPostProcessor的请求下,添加:线程组->后置处理器->BeanShellPostProcessor

2、在BeanShell PostProcessor里输入代码,用以解析responseBody的数据并取出list中某个值,并存至文件中

例如:157 /costQuery/selectAll请求“BeanShell PostProcessor”的所有代码

import org.json.JSONObject;

import org.json.JSONArray;

 

St

猜你喜欢

转载自blog.csdn.net/fen_fen/article/details/103687401