参数化对话框中与参数取值方式有关的区域如下:

改变参数化的取值方式,关键在于Select next row和Update value on这两个选项。

  Select next row包括以下选项:

  • Sequential:顺序方式
  • Random:随机方式
  • Unique:唯一方式

  Update value on包括如下选项:

  • Each iteration:每次迭代更新取值
  • Each occurrence:每次取值更新
  • Once:只更新一次

以下代码以登录接口和参数化进行演示,参数化文件中有2个值

lr_output_message("login_username:%s",lr_eval_string("{login_username}"));

web_custom_request("login",
"URL=http://192.168.44.130:8080/mobile/api/user/login",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"EncType=application/json;charset=utf-8",
"Body={\"mobile\":\"{login_username}\",\"password\":\"123456\"}",
LAST);

 参数化文件中的数据为:

13141140058

第一种取值方式:Sequential+Each iteration,设置迭代次数为3次,参数取值结果为:

Starting iteration 1.
Maximum number of concurrent connections per server: 6 [MsgId: MMSG-26989]
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(20): web_custom_request("login") started [MsgId: MMSG-26355]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(20): web_custom_request("login") was successful, 361 body bytes, 157 header bytes, 12 chunking overhead bytes [MsgId: MMSG-26385]
Ending action Action.
Ending iteration 1.
Starting iteration 2.
Notify: Next row for parameter login_username = 2 [table = login_username].
Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '0' row = '2'.
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(18): login_username:13141140058
Action.c(20): web_custom_request("login") started [MsgId: MMSG-26355]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(20): web_custom_request("login") was successful, 361 body bytes, 157 header bytes, 12 chunking overhead bytes [MsgId: MMSG-26385]
Ending action Action.
Ending iteration 2.
Starting iteration 3.
Notify: Next row for parameter login_username = 1 [table = login_username].
Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '0' row = '1'.
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(20): web_custom_request("login") started [MsgId: MMSG-26355]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(20): web_custom_request("login") was successful, 361 body bytes, 157 header bytes, 12 chunking overhead bytes [MsgId: MMSG-26385]
Ending action Action.
Ending iteration 3.

 第二种取值方式:Sequential+Each occurrence,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .

第三种取值方式:Sequential+Once,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .

第四种取值方式:Random+Each iteration,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(18): login_username:13141140058
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Notify: Next row for parameter login_username = [table = login_username].
Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Notify: Next row for parameter login_username = [table = login_username].
Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(18): login_username:13141140058
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .

第五种取值方式:Random+Each occurrence,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .

第六种取值方式:Random+Once,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .

第七种取值方式:Unique+Each iteration

这种取值方式,又可以有以下几种设置:

当值不足时,可以选择以下3种方式:

1)、中断虚拟用户

2)、循环取参数中的值,返回到第一行取值

3)、取最后一行值

以下运行结果以Abort Vuser为例执行,其它情况可自行设置运行,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Notify: Next row for parameter login_username = [table = login_username].
Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(18): login_username:13141140058
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Error: Parameter 'login_username': No more unique values for this parameter in table 'login_username.dat' [unique range is 1-2]. The Vuser is aborted according to "When Out Of Values" policy.
Action was aborted.
Ending Vuser...

第八种取值方式:Unique+Each occurrence,参数不够用时,也会报错,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(): Notify: Next row for parameter login_username = [table = login_username].
Action.c(): Notify: Getting new value for parameter 'login_username': table = 'login_username.dat' column = '' row = ''.
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140058"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Error: Parameter 'login_username': No more unique values for this parameter in table 'login_username.dat' [unique range is 1-2]. The Vuser is aborted according to "When Out Of Values" policy.
Abort was called from an action.
Ending Vuser...

第九种取值方式:Unique+Once,参数不够用时,也会报错,设置迭代次数为3次,参数取值结果为:

Starting iteration .
Maximum number of concurrent connections per server: [MsgId: MMSG-]
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .
Starting iteration .
Starting action Action.
Action.c(18): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(18): login_username:13141140050
Action.c(): web_custom_request("login") started [MsgId: MMSG-]
Action.c(20): Notify: Parameter Substitution: parameter "login_username" = "13141140050"
Action.c(): web_custom_request("login") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Ending action Action.
Ending iteration .

总结:

loadrunner 参数化取值方式详解的更多相关文章

  1. LoadRunner参数化取值与连接数据库

    LoadRunner参数化取值与连接数据库   LoadRunner在使用参数化的时候,通常都是需要准备大数据量的,也因此LoadRunner提供两种参数化取值方式,一种是手动编辑,另一种就是通过连接 ...

  2. Loadrunner中参数化取值方式分析

    Loadrunner中参数化取值依赖两个维度: 1.取值顺序分为“顺序”“随机”“唯一”.    select next row:Sequential , Random,unique 2.更新值时分为 ...

  3. cin 对象取值过程详解

    突然又空,鉴于对cin对象的去值机制还不是很了解,就探究一番,并且记下来,方便以后复习. #include <iostream> int main(void) { using namesp ...

  4. mysql数据库TINYINT取值范围详解

    分享下mysql中TINYINT的取值范围,很基础的一些内容. 在MySQL的数据类型中,Tinyint的取值范围是:带符号的范围是-128到127.无符号的范围是0到255(见官方<MySQL ...

  5. JS子父窗口互相取值赋值详解介绍

    子窗口赋值到父窗口 代码如下 复制代码 <script>function openWin(str) {    window.open(siteurl+"popup/"+ ...

  6. LoadRunner参数化取值及连接数据库操作步骤

    很多情况下,参数添加的数据不是十条二十条,也不是一百两百,对于这种大数量的数据我们可以通过数据库将数据导入: 选中要参数化的内容如下图一所示: 方法一,右键---[Replace with a new ...

  7. loadrunner脚本中写入脚本输出log到外部文件,分析参数取值方式

    loadrunner脚本中写入脚本输出log到外部文件,分析参数取值方式 分类: 心得 loadrunner 我的测试 2012-04-01 12:52 2340人阅读 评论(0) 收藏 举报 脚本l ...

  8. JSON取值(key是中文或者数字)方式详解

    JSON取值(key是中文或者数字)方式详解 先准备一个json对象用于演示 var json = {'name':'zhangsan', '年龄':23, 404:'你可能迷路了'}; 使用JS中w ...

  9. LoadRunner中,参数化时Unique取值方式的理解

    LoadRunner中,参数化时Unique取值方式的理解 2012年10月15日 18:10:36 瑞秋 阅读数:10028   在LoadRunner中进行参数化时,Parameter的取值设置有 ...

随机推荐

  1. 2018-2019-2 网络对抗技术 20165321 Exp6 信息搜集与漏洞扫描

    1.实践目标 掌握信息搜集的最基础技能与常用工具的使用方法. 2.实践内容 (1)各种搜索技巧的应用 百度查找IP地址: 查了一下kali的IP地址 https://fofa.so/的使用: 查询了一 ...

  2. vue-cli@2的原理解析

    作为一个菜鸟,我有一颗好奇的心,每当vue init 的时候,看到那流畅的进度和神奇的结果,心里都充满一窥其本质的期望…… 以下就是我不断的console,大致理出来的一个流程心得,纪录在此,以作备忘 ...

  3. elasticsearch开机启动脚本

    最近搭建了一个elasticsearch服务,其中机器重启而ES服务没有重启是问题,就有下面的脚本 #!/bin/sh #chkconfig: #description: es export JAVA ...

  4. Excel坐标自动在AutoCad绘图_4

    众所周知,Excel对数据处理的功能非常强大,它可以进行数据处理.统计分析已经辅助决策的操作,该软件已经渗透到各个领域.作为一个测绘人,GISer, 也经常利用excel完成一些测量表格的自动化计算, ...

  5. oracle 11g 安装步骤

    指定安装路径 输入数据库名(cwbpm),(按照自己要求输入,可以直接用默认库名) 输入密码(自定义):123456 (自定义密码) 下一步 选择“是” 点击完成,开始安装数据库 安装完成后会弹出页面 ...

  6. 实验1 C语言开发环境使用和数据类型,运算符,表达式

    part :验证性内容 .输出学号. #include<stdio.h> int main(void){ printf("); ; } .输入两个整数,求它们的乘积. #incl ...

  7. 编译原理 #03# 龙书中缀转后缀JS实现版

    // 来自龙书第2章2.5小节-简单表达式的翻译器 笔记 既然是语法制导翻译(Syntax-directed translation),那么最重要的东西当然是描述该语言语法的文法,以下为中缀表达式文法 ...

  8. Hibernate一级缓存和二级缓存详解

    (1)一级缓存 是Session级别的缓存,一个Session做了一个查询操作,它会把这个操作的结果放在一级缓存中,如果短时间内这个session(一定要同一个session)又做了同一个操作,那么h ...

  9. webviewplugin

    https://blog.csdn.net/qq_39197547/article/details/85007418 https://www.cnblogs.com/pjl43/p/9866753.h ...

  10. 根据文字动态计算Label高度或宽度

    //根据已知的label宽度计算文字高度 CGRect rect = [reson boundingRectWithSize:CGSizeMake(label_W, 0) options:NSStri ...