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

改变参数化的取值方式,关键在于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. Android编程 控件与布局

    控件和布局的继承结构 常用控件 1.TextView <?xml version="1.0" encoding="utf-8"?> <Line ...

  2. C++实验三

    part2 graph.h #ifndef GRAPH_H#define GRAPH_H// 类Graph的声明 class Graph { public: Graph(char ch, int n) ...

  3. git使用手册整理

    -------------------20181217------------------- git使用:在gitbash 下初始化用户: $ git config --global user.nam ...

  4. Python3.0科学计算学习之函数

    函数 函数允许程序的控制在不同的代码片段之间切换,函数的重要意义在于可以在程序中清晰地分离不同的任务,将复杂的问题分解为几个相对简单的子问题,并逐个解决.即"分而治之". Pyth ...

  5. navicat 远程访问mariadb失败,修改配置如下

    1.首先配置允许访问的用户,采用授权的方式给用户权限 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '121212' WITH GRAN ...

  6. Haproxy小酌

    1.Haproxy简介 负载均衡: 基于软件:HAProxy(四层+七层),Nginx(七层) 基于操作系统:LVS(四层) 作用:实现高可用,负载均衡,基于TCP(第四层)和HTTP(第七层)的应用 ...

  7. PureMVC 官方文档翻译(一)

    最近在学习PureMVC框架,感觉最权威的还是阅读官方文档,顺便翻译了下全当记笔记了. PureMVC概览 这篇文档他讨论PureMVC框架的类和接口,使用UML来阐述它们的角色.职责和协作. Pur ...

  8. c# 笔记cookie

    if (Request.Cookies["svpoint"] != null) { Request.Cookies[].s_SvcID.ToString(); } else { H ...

  9. vue:vuex中mapState、mapGetters、mapActions辅助函数及Module的使用

    一.普通store中使用mapState.mapGetters辅助函数: 在src目录下建立store文件夹: ​ index.js如下: import Vue from 'vue'; import ...

  10. C语言输出

    转自:https://blog.csdn.net/u014647208/article/details/53337315 int PrintVal = 9; /*按整型输出,默认右对齐*/ print ...