lr编辑附件上传脚本
请问在url的custom模式下录制的脚本,通过添加脚本可以实现本地附件的上传吗?网上查了下,有些朋友说只能基于html录制的脚本。
网上寻找方法,有这样的脚本:
web_custom_request("attach.php",
"URL=http://mail.topwalk.com/igenus/attach.php?Cmd=add",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://mail.topwalk.com/igenus/send.php",
"Snapshot=t9.inf",
"Mode=HTML",
"EncType=multipart/form-data; boundary=---------------------------7d71a5e130658",
LAST);
请问有没有错误的地方,要上传成功,我还需要对这段脚本修改哪些地方呢?
时间紧迫啊,这次测试是要测试OA系统中邮件的压力,需要在邮件里添加附件,以下是点击“发送邮件”前后录制的脚本:(自己觉得应该在此编辑脚本)
lr_start_transaction("发送");
web_custom_request("smartweb2.showRPCLoadingTip.d",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t263.inf",
"Mode=HTTP",
"Body=skin=liquidblue",
LAST);
web_custom_request("smartweb2.loadFile.d_110",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.loadFile.d?file=/skins/liquidblue/loading.gif",
"Method=GET",
"Resource=1",
"RecContentType=application/octet-stream",
"Referer=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Snapshot=t264.inf",
"Body=file=/skins/liquidblue/loading.gif",
LAST);
web_custom_request("smartweb2.showRPCSubmitter.d",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCSubmitter.d",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Snapshot=t265.inf",
"Mode=HTTP",
LAST);
web_custom_request("marmot.update.d",
"URL=http://130.1.1.128:9080/JavaOA/marmot.update.d?__rpc=true&__rpcAgent=true",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCSubmitter.d",
"Snapshot=t266.inf",
"Mode=HTTP",
"Body=__type=updateData&__xml=%3Crpc+transaction%3D%2210%22+method%3D%22insertRecord%22%3E%3Cdef%3E%3Cdataset+type%3D%22wrapper%22+id%3D%22datasetUserMail%22%3E%3Cf+name%3D%22select%22+type%3D%229%22%2F%3E%3Cf+name%3D%22ID%22%2F%3E%3Cf+name%3D%22MAIL_ID%22%2F%3E%3Cf+name%3D%22SENDER_ID%22%2F%3E%3Cf+name%3D%22ADDRESSEE_ID%22%2F%3E%3Cf+name%3D%22STYLE%22%2F%3E%3Cf+name%3D%22CREATED_BY%22%2F%3E%3Cf+name%3D%22CREATION_DATE%22+type%3D%2210%22%2F%3E%3Cf+name%3D%22LAST_UPDATED_BY%22%2F%3E%3Cf+"
"name%3D%22LAST_UPDATE_DATE%22+type%3D%2210%22%2F%3E%3Cf+name%3D%22LAST_UPDATE_IP%22%2F%3E%3Cf+name%3D%22VALID_FLAG%22%2F%3E%3Cf+name%3D%22VERSION%22+type%3D%225%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_01%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_02%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_03%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_04%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_05%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_06%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_07%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_08%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_09%22%2F%3E%3Cf+"
"name%3D%22ATTRIBUTE_10%22%2F%3E%3Cf+name%3D%22MID%22%2F%3E%3Cf+name%3D%22TITLE%22%2F%3E%3Cf+name%3D%22CONTENT%22%2F%3E%3Cf+name%3D%22ADDRESSEELIST_ID%22%2F%3E%3Cf+name%3D%22CREATEDATE%22+type%3D%2210%22%2F%3E%3Cf+name%3D%22COPIERLIST_ID%22%2F%3E%3Cf+name%3D%22SENDER_NAME%22%2F%3E%3Cf+name%3D%22ADDRESSEE_NAME%22%2F%3E%3Cf+name%3D%22ADDRESSEELIST_NAME%22%2F%3E%3Cf+name%3D%22COPIERLIST_NAME%22%2F%3E%3Cf+name%3D%22attachFile%22%2F%3E%3Cf+name%3D%22SECRET_LEVEL%22%2F%3E%3Cps%3E%3Cp+"
"name%3D%22mode%22%3Esubmit%3C%2Fp%3E%3C%2Fps%3E%3C%2Fdataset%3E%3C%2Fdef%3E%3Cdata%3E%3Crs+dataset%3D%22datasetUserMail%22%3E%3Cr+id%3D%2210020%22+state%3D%22insert%22%3E%3Cn%3E%3Cv+s%3D%223%22%3EF88B6279E7F740A78FA6590B33EDDBC0%3C%2Fv%3E%3Cv+s%3D%221%22%3E1%3C%2Fv%3E%3Cv+s%3D%225%22%3E1%3C%2Fv%3E%3Cv+s%3D%2212%22%3Eperformance%3C%2Fv%3E%3Cv%3E%253CP%253Eperformance%253C%2FP%253E%3C%2Fv%3E%3Cv%3ED46C8901387A4F32BBF36301F5E9509C%3C%2Fv%3E%3Cv%3E1274244316859%3C%2Fv%3E%3Cv+"
"s%3D%223%22%3E%25u6881%25u4E3D%25u6D9B%3C%2Fv%3E%3Cv+s%3D%222%22%3E1%3C%2Fv%3E%3C%2Fn%3E%3C%2Fr%3E%3C%2Frs%3E%3C%2Fdata%3E%3Cps%3E%3Cp+name%3D%22_resolver%22%3EoaUserMailAction%3C%2Fp%3E%3C%2Fps%3E%3C%2Frpc%3E&__viewInstanceId=avicit.oa.module.pi.userMail.view.oaUserMailSendAdd%7Eorg.marmot.security.dorado.SecurityViewModel",
LAST);
web_custom_request("smartweb2.loadFile.d_111",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.loadFile.d?file=/skins/liquidblue/loading.gif",
"Method=GET",
"Resource=1",
"Referer=http://130.1.1.128:9080/JavaOA/oa/module/pi/userMail/oa_user_mail_send_add.jsp",
"Body=file=/skins/liquidblue/loading.gif",
LAST);
web_custom_request("uploadController.d",
"URL=http://130.1.1.128:9080/JavaOA/uploadController.d",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://130.1.1.128:9080/JavaOA/oa/module/pi/userMail/oa_user_mail_send_add.jsp",
"Snapshot=t267.inf",
"Mode=HTTP",
"EncType=multipart/form-data; boundary=---------------------------7da034110410",
body_variable_1,
LAST);
web_custom_request("smartweb2.showRPCLoadingTip.d_2",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t268.inf",
"Mode=HTTP",
"Body=skin=liquidblue",
LAST);
web_custom_request("smartweb2.loadFile.d_112",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.loadFile.d?file=/skins/liquidblue/loading.gif",
"Method=GET",
"Resource=1",
"Referer=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Body=file=/skins/liquidblue/loading.gif",
LAST);
web_custom_request("smartweb2.showRPCSubmitter.d_2",
"URL=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCSubmitter.d",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Snapshot=t269.inf",
"Mode=HTTP",
LAST);
web_custom_request("marmot.rpc.d_2",
"URL=http://130.1.1.128:9080/JavaOA/marmot.rpc.d?__rpc=true&__rpcAgent=true",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://130.1.1.128:9080/JavaOA/dorado/smartweb2.showRPCSubmitter.d",
"Snapshot=t270.inf",
"Mode=HTTP",
"Body=__type=base&__xml=%3Crpc+method%3D%22dealMailAttach%22%3E%3Cps%3E%3Cp+name%3D%22mail_id%22%3E0281810028aecb0a0128aee1fcc60019%3C%2Fp%3E%3Cp+name%3D%22STYLE%22%3E1%3C%2Fp%3E%3Cp+name%3D%22_resolver%22%3EoaUserMailAction%3C%2Fp%3E%3C%2Fps%3E%3C%2Frpc%3E&__viewInstanceId=avicit.oa.module.pi.userMail.view.oaUserMailSendAdd%7Eorg.marmot.security.dorado.SecurityViewModel",
LAST);
lr_end_transaction("发送",LR_AUTO);
[ 本帖最后由 liuqi6773 于 2010-5-19 19:45 编辑 ] 自己顶一个,附件的问题从开始用lr就一直头疼,这回产品中不得不进行测试了,希望大家帮忙!能提供些建议也很感谢! 再顶一个,说下测试内容:
JAVAOA系统,对系统中邮件的性能进行测试,要模拟部分用户上传附件和发送的速度如何。 一宿了,咋没人理我...再顶上 学习..
帮顶! 含泪顶起,不抛弃不放弃 呕血顶起!!!!!!!!!!!! 你上传的附件名有在脚本中出现吗? 有出现,重放脚本,邮件是发出去了,但是附件没有挂上,也没有插入到数据库中 也有本地路径,下面是刚录的脚本,比之前的清楚点:
lr_start_transaction("发送");
web_custom_request("smartweb2.showRPCLoadingTip.d_2",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t179.inf",
"Mode=HTTP",
"Body=skin=liquidblue",
LAST);
web_custom_request("smartweb2.loadFile.d_52",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.loadFile.d?file=/skins/liquidblue/loading.gif",
"Method=GET",
"Resource=1",
"Referer=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Body=file=/skins/liquidblue/loading.gif",
LAST);
web_custom_request("smartweb2.showRPCSubmitter.d_2",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCSubmitter.d",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Snapshot=t180.inf",
"Mode=HTTP",
LAST);
// Parameter {WCSParam_Text1} created by Correlation Studio
web_reg_save_param("WCSParam_Text1",
"LB= value=\"",
"RB=\"",
"Ord=2",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
web_custom_request("marmot.update.d",
"URL=http://192.168.10.250:8081/p/marmot.update.d?__rpc=true&__rpcAgent=true",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCSubmitter.d",
"Snapshot=t181.inf",
"Mode=HTTP",
"Body=__type=updateData&__xml=%3Crpc+transaction%3D%2210%22+method%3D%22insertRecord%22%3E%3Cdef%3E%3Cdataset+type%3D%22wrapper%22+id%3D%22datasetUserMail%22%3E%3Cf+name%3D%22select%22+type%3D%229%22%2F%3E%3Cf+name%3D%22ID%22%2F%3E%3Cf+name%3D%22MAIL_ID%22%2F%3E%3Cf+name%3D%22SENDER_ID%22%2F%3E%3Cf+name%3D%22ADDRESSEE_ID%22%2F%3E%3Cf+name%3D%22STYLE%22%2F%3E%3Cf+name%3D%22CREATED_BY%22%2F%3E%3Cf+name%3D%22CREATION_DATE%22+type%3D%2210%22%2F%3E%3Cf+name%3D%22LAST_UPDATED_BY%22%2F%3E%3Cf+name%3D%22LAST_UPDATE_DATE%22+type%3D%2210%22%2F%3E%3Cf+name%3D%22LAST_UPDATE_IP%22%2F%3E%3Cf+name%3D%22VALID_FLAG%22%2F%3E%3Cf+name%3D%22VERSION%22+type%3D%225%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_01%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_02%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_03%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_04%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_05%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_06%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_07%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_08%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_09%22%2F%3E%3Cf+name%3D%22ATTRIBUTE_10%22%2F%3E%3Cf"
"+name%3D%22MID%22%2F%3E%3Cf+name%3D%22TITLE%22%2F%3E%3Cf+name%3D%22CONTENT%22%2F%3E%3Cf+name%3D%22ADDRESSEELIST_ID%22%2F%3E%3Cf+name%3D%22CREATEDATE%22+type%3D%2210%22%2F%3E%3Cf+name%3D%22COPIERLIST_ID%22%2F%3E%3Cf+name%3D%22SENDER_NAME%22%2F%3E%3Cf+name%3D%22ADDRESSEE_NAME%22%2F%3E%3Cf+name%3D%22ADDRESSEELIST_NAME%22%2F%3E%3Cf+name%3D%22COPIERLIST_NAME%22%2F%3E%3Cf+name%3D%22attachFile%22%2F%3E%3Cf+name%3D%22SECRET_LEVEL%22%2F%3E%3Cps%3E%3Cp+name%3D%22mode%22%3Esubmit%3C%2Fp%3E%3C%2Fps%3E%3C%2Fdataset%3E%3C%2Fdef%3E%3Cdata%3E%3Crs+dataset%3D%22datasetUserMail%22%3E%3Cr+id%3D%2210020%22+state%3D%22insert%22%3E%3Cn%3E%3Cv+s%3D%223%22%3EF88B6279E7F740A78FA6590B33EDDBC0%3C%2Fv%3E%3Cv+s%3D%221%22%3E1%3C%2Fv%3E%3Cv+s%3D%225%22%3E1%3C%2Fv%3E%3Cv+s%3D%2212%22%3Eperformance%3C%2Fv%3E%3Cv%3E%253CP%253Eperformance%253C%2FP%253E%3C%2Fv%3E%3Cv%3EF88B6279E7F740A78FA6590B33EDDBC0%3C%2Fv%3E%3Cv%3E1274332536016%3C%2Fv%3E%3Cv+s%3D%223%22%3E%25u738B%25u9F99%25u5764%3C%2Fv%3E%3Cv+s%3D%222%22%3E1%3C%2Fv%3E%3C%2Fn%3E%3C%2Fr%3E%"
"3C%2Frs%3E%3C%2Fdata%3E%3Cps%3E%3Cp+name%3D%22_resolver%22%3EoaUserMailAction%3C%2Fp%3E%3C%2Fps%3E%3C%2Frpc%3E&__viewInstanceId=avicit.oa.module.pi.userMail.view.oaUserMailSendAdd%7Eorg.marmot.security.dorado.SecurityViewModel",
LAST);
web_custom_request("smartweb2.loadFile.d_53",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.loadFile.d?file=/skins/liquidblue/loading.gif",
"Method=GET",
"Resource=1",
"Referer=http://192.168.10.250:8081/p/oa/module/pi/userMail/oa_user_mail_send_add.jsp",
"Body=file=/skins/liquidblue/loading.gif",
LAST);
web_custom_request("uploadController.d",
"URL=http://192.168.10.250:8081/p/uploadController.d",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.250:8081/p/oa/module/pi/userMail/oa_user_mail_send_add.jsp",
"Snapshot=t182.inf",
"Mode=HTTP",
"EncType=multipart/form-data; boundary=---------------------------7da39a21a06da",
"Body=-----------------------------7da39a21a06da\r\n"
"Content-Disposition: form-data; name=\"attach_form\"\r\n"
"\r\n"
"OA_USERMAIL\r\n"
"-----------------------------7da39a21a06da\r\n"
"Content-Disposition: form-data; name=\"attach_formId\"\r\n"
"\r\n"
"{WCSParam_Text1}\r\n"
"-----------------------------7da39a21a06da\r\n"
"Content-Disposition: form-data; name=\"autoattach_file_null_0\"; filename=\"E:\总结\测试工具相关\LR网络收集\http代码说明.txt\"\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"{附件内容,比较长,删掉了}\r\n"
......
"-----------------------------7da39a21a06da\r\n"
"Content-Disposition: form-data; name=\"autoattach_file_null_1\"; filename=\"\"\r\n"
"Content-Type: application/octet-stream\r\n"
"\r\n"
"\r\n"
"-----------------------------7da39a21a06da",
LAST);
web_custom_request("smartweb2.showRPCLoadingTip.d_3",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t183.inf",
"Mode=HTTP",
"Body=skin=liquidblue",
LAST);
web_custom_request("smartweb2.loadFile.d_54",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.loadFile.d?file=/skins/liquidblue/loading.gif",
"Method=GET",
"Resource=1",
"Referer=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Body=file=/skins/liquidblue/loading.gif",
LAST);
web_custom_request("smartweb2.showRPCSubmitter.d_3",
"URL=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCSubmitter.d",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCLoadingTip.d?skin=liquidblue",
"Snapshot=t184.inf",
"Mode=HTTP",
LAST);
web_custom_request("marmot.rpc.d_2",
"URL=http://192.168.10.250:8081/p/marmot.rpc.d?__rpc=true&__rpcAgent=true",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.250:8081/p/dorado/smartweb2.showRPCSubmitter.d",
"Snapshot=t185.inf",
"Mode=HTTP",
"Body=__type=base&__xml=%3Crpc+method%3D%22dealMailAttach%22%3E%3Cps%3E%3Cp+name%3D%22mail_id%22%3E{WCSParam_Text1}%3C%2Fp%3E%3Cp+name%3D%22STYLE%22%3E1%3C%2Fp%3E%3Cp+name%3D%22_resolver%22%3EoaUserMailAction%3C%2Fp%3E%3C%2Fps%3E%3C%2Frpc%3E&__viewInstanceId=avicit.oa.module.pi.userMail.view.oaUserMailSendAdd%7Eorg.marmot.security.dorado.SecurityViewModel",
LAST);
web_custom_request("UserMailAction!getMailNumber.action_3",
"URL=http://192.168.10.250:8081/p/oa/module/pi/userMail/UserMailAction!getMailNumber.action?randnum=0.21907190332867615",
"Method=POST",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://192.168.10.250:8081/p/oa/module/pi/userMail/oa_user_mail_menu.jsp",
"Snapshot=t186.inf",
"Mode=HTTP",
LAST);
lr_end_transaction("发送", LR_AUTO); 现在这儿OA用html方式录制回放会有错误,用url custom就没有问题,现在最想解决的是附件上传,所以没考虑用html方式,要是说lr录制附件上传只能用html方式,那我就只能重新录了。 顶到底!
我用html的第二种方式录制脚本,回放后附件也没有上传成功。 隔天,再顶一个! 能描述下你们系统框架实现基本方式吗 从文档里找到这个,不知道是不是楼上想要的
技术架构层采用MVC 模式构造,展现层使用页面展示功能强大的Dorado,业务逻辑层为Spring,数据持久层使用Hibernate+IBATIS。
技术架构层包含的主要组件和服务如下:
电子表单组件
报表组件
异常服务
缓存服务
日志服务 没试过这种,建议在上传后设一个思考时间,设长点看看!
猜想是LR直接发请求过去时,跟在页面上操作上传附件时的加载不一样引起的!请求是发了,可附件没上传好。
还建议监视下测试机,成功上传的话磁盘开销可能会很大。
[ 本帖最后由 crowsong 于 2010-5-21 17:25 编辑 ] 好的,我试试看~ 结果如何 试试看成功了???? :'(也遇到附件上传的问题了,唉,用了N种方法,要么脚本回放成功但附件没传到服务器,要么附件能传,但有警告(Warning -26276: JavaScript error (id=39) in line 1: TypeError: e.iframe has no properties),放到场景里就全部事务失败。
已经采用了多种协议的试验,真晕。
不过有个问题,如果程序是以二进制流上传过去的,要怎么编写脚本呀。 SOCKET+html 协议重新录制,应该就能解决点
页:
[1]
2