51Testing软件测试论坛
标题:
loadrunner9.5文档上传不成功,大家给点意见
[打印本页]
作者:
lychbeyond
时间:
2010-12-21 19:12
标题:
loadrunner9.5文档上传不成功,大家给点意见
录制设置,开始试过GUI-based script和HTML-based script如图
[attach]67466[/attach]
代码:
web_text_link("上传",
"Snapshot=t24.inf",
DESCRIPTION,
"Text=上传",
ACTION,
"UserAction=Click",
LAST);
web_edit_field("documentinfo.userId",
"Snapshot=t25.inf",
DESCRIPTION,
"Type=text",
"Name=documentinfo.userId",
ACTION,
"SetValue=1",
LAST);
web_list("documentinfo.type",
"Snapshot=t26.inf",
DESCRIPTION,
"Name=documentinfo.type",
ACTION,
"Select=《单位住房申请表》",
LAST);
lr_think_time(5);
lr_start_transaction("uploadOneDoc");
web_submit_data("documentUpload.action",
"Action=http://192.168.1.198:8080/UDM/business/document/documentUpload.action",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=application/pdf",
"Referer=http://192.168.1.198:8080/UDM/business/document/documentList",
"Snapshot=t12.inf",
"Mode=HTML",
ITEMDATA,
"Name=documentinfo.userId", "Value=1", ENDITEM,
"Name=documentinfo.type", "Value=1", ENDITEM,
"Name=file", "Value=C:\\struts2.pdf", "File=yes", ENDITEM,
LAST);
lr_end_transaction("uploadOneDoc", LR_AUTO);
return 0;
log输出:
uploadDocAction.c(56): web_text_link("上传") was successful, 14013 body bytes, 150 header bytes, 21 chunking overhead bytes [MsgId: MMSG-26385]
uploadDocAction.c(64): web_edit_field("documentinfo.userId") was successful [MsgId: MMSG-26392]
uploadDocAction.c(73): web_list("documentinfo.type") was successful [MsgId: MMSG-26392]
uploadDocAction.c(84): Notify: Transaction "uploadOneDoc" started.
uploadDocAction.c(87): Redirecting "
http://192.168.1.198:8080/UDM/business/document/documentUpload.action
" (redirection depth is 0) [MsgId: MMSG-26694]
uploadDocAction.c(87): To location "
http://192.168.1.198:8080/UDM/business/document/documentList.action
" [MsgId: MMSG-26693]
uploadDocAction.c(87): web_submit_data("documentUpload.action") was successful, 14013 body bytes, 346 header bytes, 21 chunking overhead bytes [MsgId: MMSG-26385]
uploadDocAction.c(104): Notify: Transaction "uploadOneDoc" ended with "Pass" status (Duration: 1.0631).
都有事务Pass了,可服务器上的文件夹里就是没有上传的文档。。。 什么原因啊?
作者:
andyguo
时间:
2010-12-22 10:48
系统是把上传文件转化成二进制的文件
作者:
lychbeyond
时间:
2010-12-22 15:14
那我怎么知道上传成功了呀,我得让服务器上的文件夹里有上传的相同命名规则的文档呀,否则怎么下载啊
作者:
婴儿
时间:
2010-12-23 11:42
把
Value=C:\\struts2.pdf 改成
Value=C:\\\\struts2.pdf 试试
作者:
阿七
时间:
2010-12-24 09:39
我上传图片 能上传成功 但是图片显示是乱的
因为传输的原因 图片先拆分后组合的
作者:
liusiyan
时间:
2010-12-24 09:53
以前我是用url-based方式录制的,上传图片可以成功,lz可以试试
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2