????LR?в???????????
????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);
????LR????????????
Action()
{
//??????????????????????????С
int flen;
//??????????
long filedes;
//???????·?????????
char file[256]="/0";
//????????????
char * strNumber;
//Returns the string argument after evaluating embedded parameters.
strNumber=lr_eval_string("{RandomNum}");
//??·?????浽file??????
strcat(file??"D://Excel//");
//????????????????file???????
strcat(file??strNumber);
//???????????????.rar?????file???????
strcat(file??".rar");
//?????????LoadRunner??????????????????????
//???ò???????????????????????????С
web_set_max_html_param_len("20000");
//??ù???????????????????????????????????????磬??÷??????????????????
web_reg_save_param("fcontent"??
"LB="??
"RB="??
"SEARCH=BODY"??
LAST);
lr_start_transaction("??????????");
//????????????????????
web_url("DownLoadServlet"??
"URL=https://testserver3/servlet/DownLoadServlet?filename=help"??
"Resource=1"??
"RecContentType=application/x-msdownload"??
"Referer="??
"Snapshot=t41.inf"??
LAST);
//???????е????????
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
if(flen > 0)
{
//??д????????
if((filedes = fopen(file?? "wb")) == NULL)
{
lr_output_message("????????!");
return -1;
}
//д?????????
fwrite(lr_eval_string("{fcontent}")?? flen?? 1?? filedes);
//??????
fclose(filedes);
}
lr_end_transaction("??????????"??LR_AUTO);
return 0;
}
??????ν???????????
????VuGen????????????????????????????correlation???????
????1. ???????
????2. ???????
???????????
????VuGen?????????????棨auto-correlationengine???????????????????????????????????ù???????????????????????????
????RuleCorrelation
???????????RecordingOptions??>??InternetProtocol??>??Correlation???????ù??????????????Щ????????????VuGen?????????????????????