Loadrunner 关于参数赋值取值的操作
1.参数的赋值和取值
lr_save_string("hello world","param");
lr_eval_string("{param}");
2.变量到参数
int x;
char *y;
y="hello";
x=10;
lr_save_int(x,"param");
lr_save_string(y,"param1");
lr_eval_string("{param}");
lr_eval_string("{param1}");
3.变量读参数
char x[100];
x="{param}";
lr_save_string("hello world","param");
lr_eval_string(x);
1 lr_eval_string(), eval应该是evaluate的缩写。
功能 如果只有一个参数,则返回当前参数的值。它的参数必须是{newParam} 的形式,也就是被大括号包起来
应用:对每个迭代过程中需要需要使用参数化的内容的时候。lr_output_message("value : %s", lr_eval_string("The row count is: {row_cnt}"));
例如:有一个int的参数化值{paraInt},如果直接把它作为一个int是错的。必须atoi(lr_eval_string({ParaInt}))
所以不能直接把一个int变量作为参数。
2.如何实现“我想把iTemp转换成字符串存到变量chArr里”
int iTemp=3;
char chArr[1024] = {0};
// if not unicode
itoa( itemp, charr, 10 );
应该可以
parameter和argument的区别
在对一个函数写一个注释时,我在考虑到底该用parameter还是用argument来描述其参数呢。
根据网上一些资料,对parameter和argument的区别,做如下的简单说明。
1. parameter是指函数定义中参数,而argument指的是函数调用时的实际参数。
2. 简略描述为:parameter=形参(formal parameter), argument=实参(actual parameter)。
3. 在不很严格的情况下,现在二者可以混用,一般用argument,而parameter则比较少用。
While defining method, variables passed in the method are called parameters.
当定义方法时,传递到方法中的变量称为参数.
While using those methods, values passed to those variables are called arguments.
当调用方法时,传给变量的值称为引数.(有时argument被翻译为“引数“)
一个C++的例子来说明二者的区别:
1 |
|
如下叙述,来自wikipedia:
http://en.wikipedia.org/wiki/Parameter_%28computer_programming%29
Just as in standard mathematical usage, the argument is thus the
actual value passed to a function, procedure, or routine (such as x in
log x), whereas the parameter is a reference to that value inside the
implementation of the function (log in this case).
See the Parameters and arguments section for more information.
Parameters and arguments
————————————————
These two terms are sometimes loosely used interchangeably; in
particular, “argument” is sometimes used in place of “parameter”.
Nevertheless, there is a difference. Properly, parameters appear in
procedure definitions; arguments appear in procedure calls.
A parameter is an intrinsic property of the procedure, included in
its definition. For example, in many languages, a minimal procedure to
add two supplied integers together and calculate the sum total would
need two parameters, one for each expected integer.
In general, a procedure may be defined with any number of parameters,
or no parameters at all. If a procedure has parameters, the part of its
definition that specifies the parameters is called its parameter list.
By contrast, the arguments are the values actually supplied to the
procedure when it is called. Unlike the parameters, which form an
unchanging part of the procedure’s definition, the arguments can, and
often do, vary from call to call. Each time a procedure
is called, the part of the procedure call that specifies the arguments
is called the argument list.
Although parameters are also commonly referred to as arguments,
arguments are more properly thought of as the actual values or
references assigned to the parameter variables when the subroutine is
called at run-time. When discussing code that is calling
into a subroutine, any values or references passed into the subroutine
are the arguments, and the place in the code where these values or
references are given is the parameter list. When discussing the code
inside the subroutine definition, the variables in
the subroutine’s parameter list are the parameters, while the values of
the parameters at runtime are the arguments.
Many programmers use parameter and argument interchangeably,
depending on context to distinguish the meaning. The term formal
parameter refers to the variable as found in the function definition
(parameter), while actual parameter refers to the actual value
passed (argument).
Loadrunner 关于参数赋值取值的操作的更多相关文章
- loadrunner 脚本优化-参数化之Parameter List参数同行取值
脚本优化-参数化之Parameter List参数同行取值 by:授客 QQ:1033553122 select next row 记录选择方式 Same line as,这个选项只有当参数多余一个时 ...
- 在LoadRunner中从数组类型的参数随机取值的方法
在LoadRunner中从数组类型的参数随机取值的方法 使用web_reg_save_param做关联后,有时候会有多个匹配值. 为了模仿用户行为随机取一个值为后续transcation所用,可以使用 ...
- loadrunner动态从mysql取值
loadrunner动态从mysql取值 [需要下载跟数据库服务器一致的dll,32位或64位] loadrunner中有参数化从数据库中取值,但是只是静态的,对于一些要实时取值的数据就game ov ...
- Python_关于多线程下变量赋值取值的一点研究
关于多线程下变量赋值取值的一点研究 by:授客 QQ:1033553122 1.代码实践1 #!/usr/bin/env python # -*- coding:utf-8 -*- __author_ ...
- Java循环一个对象的所有属性,并通过反射给这些属性赋值/取值
Java循环一个对象的所有属性,并通过反射给这些属性赋值/取值 说到循环遍历,最常见的遍历数组/列表.Map等.但是,在开发过程中,有时需要循环遍历一个对象的所有属性.遍历对象的属性该如何遍历呢?查了 ...
- TextBox只读时不能通过后台赋值取值解决办法
给页面的TextBox设置ReadOnly="True"时,在后台代码中不能赋值取值,下边几种方法可以避免: 1.不设置ReadOnly,设置onfocus=this.blur( ...
- JMeter调试参数是否取值正确,调试正则提取的结果(log.info|log.error|print)
JMeter调试参数是否取值正确,调试正则提取的结果(log.info | log.error | print) Jmeter的log输出控制(jmeter.log) 1 2 log_level.jm ...
- request.getParameter(“xxx”)的参数的取值
request.getParameter(“xxx”)的参数的取值的几种可能: 1. Html中form表单中标签的name属性: <form name="form" met ...
- LR参数组取值操作方法
LR参数组取值操作方法 奶奶的,每次都要重写一次,粘这里,以后备用.这个使用频率高. Action(){//定义一个变量int rNum; //关联参数组,前提是请求的页面中,存在参数组web_reg ...
随机推荐
- do_exit——>exit_notify()【转】
转自:http://blog.csdn.net/sunnybeike/article/details/6907322 版权声明:本文为博主原创文章,未经博主允许不得转载. /* * Send sign ...
- 获取Json对象的长度以及判断json对象是否为空
(如有错敬请指点,以下是我工作中遇到并且解决的问题) = = = = = = = = = = = = = = = = 获取Json对象的长度 = = = = = = = = = = = = = = ...
- django怎么自己创建一个中间件
中间件是什么? 中间件是类似flask函数中钩子函数的东西.可以在请求视图函数前,或者视图函数响应后处理某些事情.中间件对全部视图都有效! 中间件一般会有两个方法,process_request和pr ...
- Delphi 7 在程序中直接执行SQL脚本文件
Delphi 7 在程序中直接执行SQL脚本文件 在处理MSDE一些操作中.需要执行一些SQL脚本.有的是从SQLServer 2000中生成的SQL为后缀的脚本.在MSDE中没有企业管理器,操作都是 ...
- 详解xml
xml xml简介 XML是一种可扩展标记语言 (Extensible Markup Language, XML).是一种可扩展的标记语言,XML重在数据交换,用于不同平台或者应用程序之间交换数据,存 ...
- poj2976(01分数规划)
poj2976 题意 给出 a b 数组,一共 n 对数,其中最多可以去掉 k 对,问怎样使剩下比率(原始比率是 $ \frac{\sum_{i=1}^{n} a}{\sum_{i=1}^{n} b} ...
- Codeforces 1027F. Session in BSU
题目直通车:Codeforces 1027F. Session in BSU 思路: 对第一门考试,使用前一个时间,做标记,表示该时间已经用过,并让第一个时间指向第二个时间,表示,若之后的考试时间和当 ...
- 洛谷——P1755 斐波那契的拆分
P1755 斐波那契的拆分 题目背景 无 题目描述 已知任意一个正整数都可以拆分为若干个斐波纳契数,现在,让你求出n的拆分方法 输入输出格式 输入格式: 一个数t,表示有t组数据 接下来t行,每行一个 ...
- 中国石油大学(华东)OJ题目的HTML爬取
这几天刷华东OJ的题,写博客还要复制HTML的代码,感觉麻烦的一批,然后就去摸鱼写了个小爬虫.. 看一下运行效果吧- 输入详细的pid.cid或id即可爬取相应的html代码 一些注意要点: 关键的还 ...
- [CF232E]Quick Tortoise
题目大意: 给你一个$n\times m(n,m\leq 500)$的格子,有一些是障碍物.从一个格子出发只能向下或向右走,有$q$组询问,每次询问从一个点是否能够到达另一个点. 思路: 分治. 两点 ...