loadrunner脚本函数整理 下载本文

1、字符串类函数

web_reg_save_param(\\\\

LAST);//响应里面获取数据保存到getEncryptCode中

lr_output_message(\lr_message(\输出

lr_save_string(lr_get_host_name(),\ //lr_get_host_name()获取主机名保存到host lr_output_message (\输出 例子1:

1)参数的赋值和取值

lr_save_string(\lr_eval_string(\

2)变量到参数 int x; x=10;

lr_save_string(x,\lr_eval_string(\3)变量读参数 char x[100]; x=\

lr_save_string(\lr_eval_string(x);

例子2:

char *tmp=\

lr_save_string(\将常量777保存为参数page

lr_output_message(lr_eval_string(\ //获取并输出参数page的当前值 lr_save_string(tmp,\ //将变量保存为参数,tmp为变量 lr_output_message(lr_eval_string(\

字符串拼接复制

strcpy(passwd,CMd5(orSignMD5));//复制 strcat(passwd,\拼接 2、获取系统时间

lr_save_datetime(\lr_output_message(lr_eval_string(\3、获取主机名

lr_save_string(lr_get_host_name(),\

lr_output_message (\4、读取文件