Ethon

为什么要有方法,因为懒惰是一种美德。

   :: 首页  :: 新随笔  ::  ::  :: 管理

Jmeter从数据库中读取数据

1、测试计划中添加Mysql Jar包

2、添加线程组

 

3、添加 jdbc connection configuration

 

 

4、添加JDBC Request,从数据库中获取数据,

注意:1.Variable Name必须与第3步中的Variable Name保持一致

           2.Result variable name 结果集名称,将查询出的数据保存在account变量中,后面BeanShell PostProcessor中会使用account变量

 

 

5、添加 BeanShell PostProcessor,用于读取和保存从数据库中获取的变量

 

 

5、添加HTTP请求

注意:${username},${password}需与 BeanShell PostProcessor中定义的变量名保持一致

 

6、察看结果树

 

posted on 2019-05-08 12:43  Ethon  阅读(1047)  评论(0编辑  收藏  举报