TA的每日心情 | 无聊 2017-11-26 18:46 |
---|
签到天数: 382 天 连续签到: 1 天 [LV.9]测试副司令
|
求助各位大神大侠:
测试从服务器下载zip文件,测试服务器承受的下载性能。
脚本是网上找的,直接在LR中编辑脚本,但是在回放的时候总是会报错。
已经 取消了 Download non-HTML resources 的勾选
并且:HTTP-request connect timeout(sec),HTTP-request recive timeout(sec), HTTP Keep-Alive timeout(sec) 三个都设置成 50000了。
但是回放日志中总是会报错:
Notify: Transaction "Download" started.
Action.c(28): web_url("VideoCompanion-V2.35.160527.zip") started [MsgId: MMSG-26355]
Action.c(28): Resource "http://********.zip" not downloaded (resource downloading not requested) [MsgId: MMSG-27299] //下载的网址省略屏蔽
Action.c(28): Warning -26379: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) are deleted and will be handled as "not found" [MsgId: MWAR-26379]
Action.c(28): Error -26377: No match found for the requested parameter "Filecontent". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 99999999 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Action.c(28): Notify: Saving Parameter "Filecontent = ".
Action.c(28): Error -26374: The above "not found" error(s) may be explained by header and body byte counts being 0 and 0, respectively. [MsgId: MERR-26374]
Action.c(28): Notify: Transaction "Download" ended with "Fail" status (Duration: 0.0144).
Ending action Action.
脚本内容:
Action()
{
int flen;
long filedes;
char file[256]="\0";
//char file[256]="";
web_set_max_html_param_len("99999999");
web_concurrent_start(NULL);
web_reg_save_param("Filecontent",
"LB=",
"RB=",
"Search=ALL",
LAST);
lr_rendezvous("Download");
web_url("******.zip", //下载的文件名省略屏蔽
"URL=http://************.zip", //下载的网址省略屏蔽
"Resource=1",
"RecContentType=application/zip",
"Referer=",
"Snapshot=t1.inf",
LAST);
web_concurrent_end(NULL);
strcat(file,"D:\\");
strcat(file,lr_eval_string("*****.zip")); //下载的文件名省略屏蔽
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
if(flen > 0)
{
if((filedes = fopen(file, "wb")) == NULL)
{
lr_output_message("Open file failed!",lr_eval_string("{Filecontent}"));
return -1;
}
fwrite(lr_eval_string("{Filecontent}"),flen, 1, filedes);
fclose(filedes);
}
return 0;
}
|
|