上传附件使用断点续传的控件,回放不能上传附件
现在这个系统上传附件使用了一个支持断点续传、上传大文件的控件,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); 自己顶一下 帮忙看看! 光看脚本,也调试不料 - -!
给些建议:
1.脚本回放之前先把之前上传文件删除
2.仔细检查脚本中是否所有变量都已经关联,且关联有效.
3.从这个脚本来看,如果F:\\PMBOK2008中文版.pdf这个文件存在但是大小改变的话很有可能引起回放失败.
4.脚本中"timenow=1246427173093"和"timenow=1246427186187"这个是否需要关联,还需要再确认一下. 回复 4# 断寒
最近也在做断点续传的性能测试,上传时是将文件分成了很多段,每段大小为128K,现在遇到的问题是,回放时,报找不到段文件的错误。
错误: Error -26488: Could not obtain information about submitted file "D:\图档附件性能测试\附件\附件上传3\fujian118%2Etxt%2Epart0": _stat32 rc=-1, errno=2 . Using an empty file 。
web_submit_data("uploadAttachment.ac",
"Action=http://10.10.5.173:5678/web/top/atm/attachment/uploadAttachment.ac?jobTypeCode=Project_ProjectInfo_File&objectId=03120101034715&relateMode=1&creatorId=SuperAdmin&creatorName=超级管理员",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/plain",
"Referer=",
"Mode=HTML",
ITEMDATA,
"Name=NTKOLF_FileMd5ID", "Value={MD5}", ENDITEM,
"Name=NTKOLF_FileOriginalName", "Value=fujian1.txt", ENDITEM, //上传时选择的文件
"Name=NTKOLF_FileSize", "Value=10522597", ENDITEM,
"Name=NTKOLF_FileBlockSeqNo", "Value=0", ENDITEM,
"Name=NTKOLF_FileBlockSize", "Value=131072", ENDITEM,
"Name=NTKO_LF_BLOCK", "Value=fujian1%2Etxt%2Epart0", "File=Yes", ENDITEM, //断点续传时文件分段
LAST); 我也遇到这个问题了!!!
页:
[1]