Jmeter和LR上传文件和下载
Jmeter和LR上传文件和下载
lr_start_transaction("upload");
web_reg_save_param("attachmentId1",
"LB/IC=attachmentId\":\"",
"RB/IC=\"",
"Ord=1",
"Search=ALL",
LAST);
web_submit_data("upload.text",
"Action=http://192.168.0.1:8000/fileUpload/upload.text",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/plain",
"Referer=",
"Snapshot=t230.inf",
"Mode=HTTP",
ITEMDATA,
"Name=Filename","Value=Attachment.doc", ENDITEM,
"Name=attachmentType","Value=合同正本", ENDITEM,
"Name=Filedata","Value=Attachment.doc", "File=Yes", ENDITEM,
"Name=Upload","Value=Submit Query", ENDITEM,
LAST);
lr_end_transaction("upload",LR_AUTO);
|
lr_start_transaction("downloadApproval");
web_reg_save_param("FileName",
"LB=filename=",
"RB=.pdf",
"Ord=1",
LAST);
web_url("generateApproval.html",
"URL=http:// 192.168.0.1:8000/xx/generateApproval.html?id={PersionId}",
"Resource=1",
"RecContentType=application/x-msdownload",
"Referer=http:// 192.168.0.1:8000/xx/viewWorkflow.html?id={PersionId}",
"Snapshot=t60.inf",
LAST);
lr_message("!!filename is%s.xml",lr_eval_string("{FileName}"));
//获取二进制文件类型的文件大小
flen =web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
lr_message("Size:%d",flen);
lr_end_transaction("downloadApproval",LR_AUTO);
|
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。