|
现在这个系统上传附件使用了一个支持断点续传、上传大文件的控件,LR录制后回放不能上传附件。
上传过程:在本地选择一个文件,添加到控件的列表中(支持添加多个),然后上传附件
部分脚本附上:
Action()
{
web_reg_save_param("Sendfile_ViewState",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
web_url("SendFile.aspx",
"URL=http://192.168.3.110/xcoi/DocSendFile/SendFile.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/Frame/tree.aspx",
"Snapshot=t6.inf",
"Mode=HTML",
EXTRARES,
"Url=../App_Themes/Style_Red/images/Tool/line.gif", ENDITEM,
"Url=../App_Themes/Style_Red/images/Tool/4.gif", ENDITEM,
LAST);
/* Registering parameter(s) from source task id 278
// {Siebel_Analytic_ViewState14} = "/wEPDwUKMTc5NDUwNDM0M2QYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgMFCGlidG5TYXZlBQppYnRuRGVsZXRlBQh1bml0TGlzdKGhbVoB67lRk0+paG5vW2vqoi/1"
// */
web_reg_save_param("Siebel_Analytic_ViewState14",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
lr_think_time(24);
web_url("selectUnit.aspx",
"URL=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
web_url("selectUnit.aspx_2",
"URL=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=&ay=true&loadTree=true&loadType=selfUnit&timenow=1246427173093",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=",
"Snapshot=t8.inf",
"Mode=HTML",
LAST);
web_url("selectUnit.aspx_3",
"URL=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=&ay=true&allShow=true&timenow=1246427173093",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=",
"Snapshot=t9.inf",
"Mode=HTML",
EXTRARES,
"Url=../dtree/img/joinbottom.gif", "Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=", ENDITEM,
"Url=../dtree/img/1.gif", "Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=", ENDITEM,
"Url=../dtree/img/iconUnCheckAll.gif", "Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=", ENDITEM,
"Url=../dtree/img/page.gif", "Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=", ENDITEM,
"Url=../dtree/img/iconCheckAll.gif", "Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=", ENDITEM,
LAST);
web_url("selectUnit.aspx_4",
"URL=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=&ay=true&addList=true&unitId=1&state=0&timenow=1246427186187",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=",
"Snapshot=t10.inf",
"Mode=HTML",
LAST);
web_submit_data("selectUnit.aspx_5",
"Action=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/DocSendFile/selectUnit.aspx?lengthShow=mainUnit&parentid=TextBoxMainRecord&txtCn=",
"Snapshot=t11.inf",
"Mode=HTML",
ITEMDATA,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState14}", ENDITEM,
"Name=parentid", "Value=TextBoxMainRecord", ENDITEM,
"Name=lengthShow", "Value=mainUnit", ENDITEM,
"Name=Hidden1", "Value=", ENDITEM,
"Name=choiceUnitIds", "Value=", ENDITEM,
"Name=choiceUnitNames", "Value=", ENDITEM,
"Name=unit", "Value=on", ENDITEM,
"Name=mycheckbox", "Value=1", ENDITEM,
"Name=ibtnSave.x", "Value=40", ENDITEM,
"Name=ibtnSave.y", "Value=6", ENDITEM,
LAST);
/* Registering parameter(s) from source task id 346
// {Siebel_Analytic_ViewState17} = "/wEPDwUKMTkwMDc2NzY0MQ9kFgICAQ9kFgICBQ8QZGQWAWZkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYEBQhMaXN0Qm94MQUHQnV0dG9uMQUHQnV0dG9uMgUHQnV0dG9uNbJVV1Vmf4NcJUB2Vtn0ySgA5Ekk"
// */
web_reg_save_param("Siebel_Analytic_ViewState17",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
lr_think_time(5);
web_url("FileUpLoad.aspx",
"URL=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t12.inf",
"Mode=HTML",
EXTRARES,
"Url=../App_Themes/Style_Red/Images/ImgButton/tianjiajiangyaoshangchuandefujian.jpg", "Referer=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0", ENDITEM,
"Url=../App_Themes/Style_Red/Images/ImgButton/yichujiangyaoshangchuandefujian.jpg", "Referer=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0", ENDITEM,
"Url=../App_Themes/Style_Red/Images/ImgButton/shangchuanfujian.gif", "Referer=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0", ENDITEM,
LAST);
/* Registering parameter(s) from source task id 366
// {Siebel_Analytic_ViewState19} = "/wEPDwUKMTkwMDc2NzY0MQ9kFgICAQ9kFgQCAw8QZA8WAWYWARAFFlBNQk9LMjAwOOS4reaWh+eJiC5wZGYFGUY6XFBNQk9LMjAwOOS4reaWh+eJiC5wZGZnZGQCBQ8QZGQWAWZkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYEBQhMaXN0Qm94MQUHQnV0dG9uMQUHQnV0dG9uMgUHQnV0dG9uNb8aDOCBKsVLwKiQe1ZP6RbZdXvu"
// */
web_reg_save_param("Siebel_Analytic_ViewState19",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
lr_think_time(29);
web_submit_data("FileUpLoad.aspx_2",
"Action=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0",
"Snapshot=t13.inf",
"Mode=HTML",
ITEMDATA,
"Name=__EVENTTARGET", "Value=", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__LASTFOCUS", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState17}", ENDITEM,
"Name=File1", "Value=F:\\PMBOK2008中文版.pdf", ENDITEM, //添加附件
"Name=uploadfile", "Value=F:\\PMBOK2008中文版.pdf", ENDITEM, //添加附件
"Name=RadioButtonList1", "Value=3", ENDITEM,
"Name=TextBox1", "Value=", ENDITEM,
"Name=radIfenc", "Value=3", ENDITEM,
"Name=Button1.x", "Value=49", ENDITEM,
"Name=Button1.y", "Value=14", ENDITEM,
LAST);
lr_think_time(4);
//上传附件
web_custom_request("iWebServerMoreAnnex.aspx",
"URL=http://192.168.3.110/xcoi/DocSendFile/iWebServerMoreAnnex.aspx?DocumentID=0&SaveType=Edit&IfEnc=3",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t14.inf",
"Mode=HTML",
"EncType=multipart/form-data; boundary=---------------------------1971102512e",
"Body=-----------------------------1971102512e",
LAST);
web_custom_request("iWebServerMoreAnnex.aspx_2",
"URL=http://192.168.3.110/xcoi/DocSendFile/iWebServerMoreAnnex.aspx?DocumentID=0&SaveType=Edit&IfEnc=3",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t15.inf",
"Mode=HTML",
"EncType=multipart/form-data; boundary=---------------------------1971102512e",
"BodyBinary=-----------------------------1971102512e",
LAST);
web_custom_request("iWebServerMoreAnnex.aspx_3",
"URL=http://192.168.3.110/xcoi/DocSendFile/iWebServerMoreAnnex.aspx?DocumentID=0&SaveType=Edit&IfEnc=3",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t16.inf",
"Mode=HTML",
"EncType=multipart/form-data; boundary=---------------------------1971102512e",
"BodyBinary=-----------------------------1971102512e",
LAST);
//上传成功后,提示信息点击【确定】按钮
web_submit_data("FileUpLoad.aspx_3",
"Action=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.3.110/xcoi/DocSendFile/FileUpLoad.aspx?DocumentID=0",
"Snapshot=t78.inf",
"Mode=HTML",
ITEMDATA,
"Name=__EVENTTARGET", "Value=", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__LASTFOCUS", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState19}", ENDITEM, //19
"Name=File1", "Value=", ENDITEM,
"Name=uploadfile", "Value=", ENDITEM,
"Name=RadioButtonList1", "Value=3", ENDITEM,
"Name=TextBox1", "Value=", ENDITEM,
"Name=radIfenc", "Value=3", ENDITEM,
"Name=Button5.x", "Value=44", ENDITEM,
"Name=Button5.y", "Value=13", ENDITEM,
LAST); |
|