bingdu520 发表于 2008-3-26 17:36:56

LR录制脚本时遇到系统中有上传文件的地方怎么处理???

LR录制脚本时遇到系统中有上传文件的地方怎么处理???

云层 发表于 2008-3-26 19:29:57

这个要具体的分析,大多数上传都是吧上传内容做成http协议中的内容上传的

liangjz 发表于 2008-3-26 20:54:14

关键是采用的协议

web 协议一般可以用web_custom_request

marial 发表于 2009-3-18 17:00:57

可以采用web_submit_data函数吗?

marial 发表于 2009-3-18 17:04:16

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:13

顶一下!:lol

marial 发表于 2009-3-19 14:58:05

如何将上传的内容做成HTTP协议中的内容呢?

风华绝代 发表于 2009-10-10 13:52:34

后来呢?
页: [1]
查看完整版本: LR录制脚本时遇到系统中有上传文件的地方怎么处理???