Loadrunner(简称“LR”)对性能测试的脚本进行参数化时,由于数据量偏大,大家往往都会把数据录入到数据库表里,然后关联到LR,本文将详细介绍LR连接数据库数据进行参数化的方法
标签:
Loadrunner(简称“LR”)对性能测试的脚本进行参数化时,由于数据量偏大,大家往往都会把数据录入到数据库表里,然后关联到LR,本文将详细介绍LR连接数据库数据进行参数化的方法
首先,选中你要参数化的部分,比如我选择的是登陆时候的UserName,我的用户名是 “admin”,那我选中“admin”,右键,选择“替换为参数”
第二步,更改参数名称,这里我改成了“UserData”,然后点“属性”链接
第三步:在弹出框里,选择“数据向导”
第四步:选择“手动指定SQL语句”
第五步:选择“创建”
第六步:选择“机器数据源”页签,并选择“创建”
第七步:选择“系统数据源”
第八步:选择本机安装数据库的驱动,因为我新建的数据库在sql 2008上,所以我选择的是最下面的
第九步:直接完成
第十步:查看数据库连接引擎里的服务器名称
第十一步:输入你建立的数据库名称
第十二步:输入SQL验证的用户名和密码
第十三步:选中新建的数据库
第十四步:选择完成
第十五步:此处是你选择数据库的相关信息
第十六步:点击完确定后,你将会看到在”机器数据源“页签下,多了一个你刚建的系统数据库,然后选中它
第十七步:选中后,在弹出的框内 输入sql 验证的sa密码
第十八步:这样的话,数据库连接串就建立完毕,在下面输入你的数据库表查询语句即可
第十九步:点击”完成“后,将会看到数据库的值已经加入到参数列表
附录:我的数据库表的结构
Description - a description or comment about the data in the data source. For example, "Hire date, salary history, and current review of all employees." The Description field is optional.
TNS Service Name - the location of the Oracle database from which the ODBC driver will retrieve data. This is the same name entered in configuring network database services using the Oracle Net Manager. For more information, see the Oracle Net Services documentation and Using the Oracle ODBC Driver for the First Time. The TNS Service Name can be selected from a pulldown list of available TNS names. For example, "ODBC-PC". You must enter a TNS Service Name.
User ID - the user name of the account on the server used to access the data. For example, "scott". The User ID field is optional.标签:
原文地址:http://www.cnblogs.com/qmfsun/p/4241969.html