loadrunner函数

1、web_submit_data()

函数语法:web_submit_data( const char *StepName, const char *Action, <List of Attributes>, ITEMDATA, <List of data>, [ EXTRARES, <List of Resource Attributes>,] LAST);

函数参数:

StepName 为该操作步骤起的名字
Action URL;要访问的地址
List of Attribute

Method:数据提交的方法:POST或GET。默认是POST

EncType:编码方式

TargetFrame:包含当前链接或资源的Frame

Mode:录制脚本的级别:HTML或HTTP

referer:当前页面关联的页面

RecontentType:录制脚本时响应头的内容类型

ITEMDATA 数据域与属性的分隔符
EXTRARES 分隔符。标记下一个参数将是资源属性列表
List of Resource Attribute  
LAST 结束标记符

 

 

 

 

 

 

 

 

 

2、web_url()

函数语法:web_url( const char *StepName, const char *url, <List of Attributes>, [EXTRARES, <List of Resource Attributes>,] LAST );

函数参数:参照web_submit_data()

3、web_get_int_property()

函数语法:web_get_int_property( const int HttpInfoType ); 

函数参数:

HTTP_INFO_RETURN_CODE:返回页面http代码

HTTP_INFO_DOWNLOAD_SIZE:返回页面字节数

HTTP_INFO_DOWNLOAD_TIME:返回页面下载时间

例子:

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);

if (HttpRetCode == 200)

lr_log_message("The Vuser successfully accessed the Dogbert home page");

else

lr_log_message("The Vuser failed to access the Dogbert home page ");

}

4、lr_convert_string_encoding()

函数语法:lr_convert_string_encoding( const char *sourceString, const char *fromEncoding, const char *toEncoding, const char *paramName); 

参数:

sourceString 要做转化的源字符串
fromEncoding 转化前的字符集编码
toEncoding 要转化成的字符集编码
paramName 转化后的目标字符串

 

 

 

5、lr_eval_string()

函数语法:lr_eval_string("{当前想要获取的参数名}");//获取当前参数的值

6、atoi()

函数语法:atoi(要转成整型的字符);  //把指定的字符串换成整型

 

原文地址:https://www.cnblogs.com/mylanguage/p/5625294.html