51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4505|回复: 2
打印 上一主题 下一主题

【推荐原文】LoadRunner 9: Simulate Parameters

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-1-5 13:33:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
作者: Ron Foster
推荐理由:关于LoadRunner模拟参数
请查阅 http://www.loadtester.com/lr9simulateparam.php


Anyone who has written a script in LoadRunner has probably used parameters before. A parameter is a substitution for a hard coded values when there needs to be different data values submitted on each new iteration if the script. One way to feed new information in is by creating a data file (similar to a CSV delimited file). You can create your own .DAT files with multiple columns, convert them from excel spreadsheets, or from SQL extracts from the database.  Then point your parameter to the .DAT file. HP's Virtual User Generator (VuGEN) scripting tool for LoadRunner has multiple options for choosing which data will be selected upon each new iteration. Select the drop down menu for "Select next row" and you will see the following choices:

Sequential
Random
Unique
Same Line as (if there are multiple parameters in the script)
Check out the LoadRunner books online or help documentation if you need details on how these choices work and how to get there in VuGEN.

With a larger data set, you might want to visualize just how random the "Random" option is -  how LoadRunner will use these data values throughout the duration of the test. With LoadRunner 9 we have a new feature, Simulate Parameter, to do that. When you look at the Parameter Properties sheet, there is a new button. See the graphic #1 below:






In this particular case I want to see how often my users will be chosen for logging in throughout the test if I have a load of 10 virtual users iterating 10 times each. By clicking on the "Simulate Parameter" button, it launches the Parameter Simulation sheet, which will allow me to select the number of virtual users I plan on running, and the number of iterations. I can also tell it to look at the current Run-Time setting values I have set up in the script for this information. See graphic #2 below:




Now I have an idea of how the test scenario will play out by virtual user, and by iteration. This would help if you suspected that you had too few values in your parameter file and the timings were getting skewed. It you were getting errors within scripts, you might find out that its due to database locks because the same data is being used at the same time, or some other data violation. Note that by viewing this, it does not modify the data file to match the listing you see. It's simply a way to see how the data would be used if you kicked off a test. Now you have a way to visualize a dry run on those Parameters without launching a test.

[ 本帖最后由 namisang 于 2009-1-5 13:34 编辑 ]
单选投票, 共有 2 人参与投票
100.00% (2)
0.00% (0)
您所在的用户组没有投票权限

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2009-1-7 12:17:41 | 只看该作者
参数模拟(Parameter simulator),是LR9的新特性之一,可用于模拟Controller运行脚本时读取参数表格数据的情形,从而可在让脚本编写人员在VuGen中编写脚本时就设计和调整好数据。

例如在脚本中有个用户名需要参数化,我们在参数列表中增加参数并添加好数据后,可以单击“Simulate Parameter…”按钮,调出参数模拟界面。



如果设计的数据只有4条,而模拟Controller中的场景运行时设置的Vusers数量是5,则会看到最后一个Vuser没有对应的数据,这必然会导致测试运行失败。



由此可见,通过参数模拟,可以预先知道参数设计是否合理,避免在Controller设计场景并运行测试后才发现数据设计的缺陷。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
回复

使用道具 举报

该用户从未签到

3#
发表于 2009-1-7 12:18:56 | 只看该作者
觉得两篇文章很类似。。。。
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-25 20:56 , Processed in 0.107381 second(s), 31 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表