51Testing软件测试论坛
标题:
LR录制脚本时遇到系统中有上传文件的地方怎么处理???
[打印本页]
作者:
bingdu520
时间:
2008-3-26 17:36
标题:
LR录制脚本时遇到系统中有上传文件的地方怎么处理???
LR录制脚本时遇到系统中有上传文件的地方怎么处理???
作者:
云层
时间:
2008-3-26 19:29
这个要具体的分析,大多数上传都是吧上传内容做成http协议中的内容上传的
作者:
liangjz
时间:
2008-3-26 20:54
关键是采用的协议
web 协议一般可以用web_custom_request
作者:
marial
时间:
2009-3-18 17:00
可以采用web_submit_data函数吗?
作者:
marial
时间:
2009-3-18 17:04
Action()
{
lr_think_time(6);
web_url("ehswebCourse.do",
"URL=http://localhost:8080/ehs/ehswebCourse.do?method=search",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost:8080/ehs/ehslogin.do?method=doLogin",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=images/side_menu_bg_1.jpg", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
"Url=images/side_menu_bg_2.jpg", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
"Url=images/side_menu_bg_3.gif", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
"Url=images/first_disabled.jpg", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
"Url=images/previous_disabled.jpg", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
"Url=images/next.jpg", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
"Url=images/last.jpg", "Referer=http://localhost:8080/ehs/ehswebCourse.do?method=search", ENDITEM,
LAST);
web_link("Checklist",
"Text=Checklist",
"Snapshot=t5.inf",
LAST);
web_submit_data("ehsChecklist.do",
"Action=http://localhost:8080/ehs/ehsChecklist.do?method=loadChecklist&detailChecklistUuid=4028f6af200200a0012002112a220001",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:8080/ehs/ehsChecklist.do?method=displayChecklist",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=ordering", "Value=ASC", ENDITEM,
"Name=orderName", "Value=", ENDITEM,
"Name=newField", "Value=", ENDITEM,
"Name=searchChecklistType", "Value=searchChecklistCode", ENDITEM,
"Name=searchChecklistCode", "Value=", ENDITEM,
"Name=searchChecklistTitle", "Value=", ENDITEM,
"Name=searchChecklistCategory", "Value=", ENDITEM,
LAST);
lr_think_time(7);
web_submit_data("saveOrSubmitChecklistServlet",
"Action=http://localhost:8080/ehs/saveOrSubmitChecklistServlet?mode=submit&from=",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/html",
"Referer=http://localhost:8080/ehs/ehsChecklist.do?method=loadChecklist&detailChecklistUuid=4028f6af200200a0012002112a220001",
"Snapshot=t7.inf",
"Mode=HTML",
ITEMDATA,
"Name=itemYesOrNo", "Value=", ENDITEM,
"Name=detailChecklistUuid", "Value=4028f6af200200a0012002112a220001", ENDITEM,
"Name=startTime", "Value=1237422840093", ENDITEM,
"Name=from", "Value=", ENDITEM,
"Name=fileField", "Value=C:\\Documents and Settings\\Administrator\\My Documents\\image\\072.TIF", "File=Yes", ENDITEM,
"Name=fileField", "Value=C:\\Documents and Settings\\Administrator\\My Documents\\image\\072.TIF", "File=Yes", ENDITEM,
LAST);
return 0;
}
以上是我录制上传图片的脚本,回放或运行的时候,上传的图片没有提交成功,不知道是什么原因,请指教!
谢谢!
作者:
marial
时间:
2009-3-19 14:56
顶一下!
作者:
marial
时间:
2009-3-19 14:58
如何将上传的内容做成HTTP协议中的内容呢?
作者:
风华绝代
时间:
2009-10-10 13:52
后来呢?
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2