BeanShell PostProcessor 可对url请求参数、请求返回的结果进行处理赋值等操作;
步骤:
BeanShell PostProcessor 对url 返回的json进行提取:
json的数据格式为:{"data":{"total":5,"list":[{"enabled":true,"lastLoginTime":00,"name":"超级管理员","id":1,"state":"Normal","username":"admin"},{"enabled":true,"lastLoginTime":1,"name":"普通管理员","id":2,"state":"Normal","username":"adminment"},}
1、采用import org.json.* 进行处理:
使用 org.json必须引入的包:下载
下载的包放到jmeter目录下的lib目录中,记得重启jmeter
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 impor