|
录制设置,开始试过GUI-based script和HTML-based script如图
代码:
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了,可服务器上的文件夹里就是没有上传的文档。。。 什么原因啊? |
|