51Testing软件测试论坛
标题:
关于Loadrunner测试上传文档的问题~急~谢谢~
[打印本页]
作者:
小七七
时间:
2008-9-8 14:28
标题:
关于Loadrunner测试上传文档的问题~急~谢谢~
使用Loadrunner测试上传文档,找了个上传文档的网站
http://www.brsbox.com/
录制的时登陆--上传--登出的过程,想请问的是录制成功后,在脚本中修改了本地文档的路径,为什么每次回放时上传的
都是录制时那个文档呢?还需做什么修改吗?是不是需要设置关联啊?
主要是下面的脚本的红色部分中,sid和uid是不是都因为是录制时的数据,才造成每次回放上传的都是录制时的文档?需要修改吗?
谢谢各位~
录制后脚本如下:(由于太长,删去了一些载入的缓存,广告和登出部分)
Action()
{
web_url("www.brsbox.com",
"URL=http://www.brsbox.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/img0.29/bg1_1.gif", ENDITEM,
"Url=/img0.29/icon_zc.gif", ENDITEM,
"Url=/img0.29/index.gif", ENDITEM,
"Url=http://log.brsbox.com/__log.gif?rv=1.0&rr=&rh=www.brsbox.com&ru=/&rt=BRSBOX%E9%A6%96%E9%A1%B5%7CBRSBOX%20%E5%85%8D%E8%B4%B9%E7%BD%91%E7%BB%9C%E7%A1%AC%E7%9B%98&rfl=9.0%20r124&rjvm=1&rlng=zh-cn&rcs=gb2312&rss=1024x768&rsd=32-bit&rg=8195985&rui=&ruu=697050534.228394598&ruc=1357659177&rs=43094950", ENDITEM,
"Url=http://www.google-analytics.com/ga.js", ENDITEM,
"Url=/img0.29/bg6.gif", ENDITEM,
"Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=732186265&utmhn=www.brsbox.com&utmcs=gb2312&utmsr=1024x768&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=9.0%20r124&utmdt=BRSBOX%E9%A6%96%E9%A1%B5%7CBRSBOX%20%E5%85%8D%E8%B4%B9%E7%BD%91%E7%BB%9C%E7%A1%AC%E7%9B%98&utmhid=1880791428&utmr=-&utmp=/&utmac=UA-2325498-4&utmcc=__utma%3D269387170.3752004810809567000.1220849989.1220850225.1220850428.3%3B%2B__utmz%3D269387170.1220849989.1.1.utmcsr%3Dhi.baidu.com%7Cutmccn%3D(referral)"
"%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%25b7%25ba%25c2%25dd%2Fblog%2Fitem%2F71f5b0360e8268340a55a928.html%3B", ENDITEM,
"Url=/js0.30/upload_index.js", ENDITEM,
LAST);
web_submit_data("beforelogin",
"Action=http://www.brsbox.com/user/beforelogin/",
"Method=POST",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=uname", "Value=journey", ENDITEM,
"Name=pwd", "Value=password", ENDITEM,
LAST);
web_submit_data("login",
"Action=http://www.brsbox.com/user/login",
"Method=POST",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=uname", "Value=journey", ENDITEM,
"Name=pwd", "Value=password", ENDITEM,
EXTRARES,
"Url=../img0.29/bg3.gif", "Referer=http://www.brsbox.com/", ENDITEM,
"Url=../img0.29/faqlogo.gif", "Referer=http://www.brsbox.com/", ENDITEM,
"Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=1028908437&utmhn=www.brsbox.com&utmcs=gb2312&utmsr=1024x768&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=9.0%20r124&utmdt=BRSBOX%E9%A6%96%E9%A1%B5%7CBRSBOX%20%E5%85%8D%E8%B4%B9%E7%BD%91%E7%BB%9C%E7%A1%AC%E7%9B%98&utmhid=1757459704&utmr=0&utmp=/&utmac=UA-2325498-4&utmcc=__utma%3D269387170.3752004810809567000.1220849989.1220850225.1220850428.3%3B%2B__utmz%3D269387170.1220849989.1.1.utmcsr%3Dhi.baidu.com%7Cutmccn%3D(referral)"
"%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%25b7%25ba%25c2%25dd%2Fblog%2Fitem%2F71f5b0360e8268340a55a928.html%3B", "Referer=http://www.brsbox.com/", ENDITEM,
LAST);
web_custom_request("newdirid",
"URL=http://www.brsbox.com/filebox/redirid/newdirid/",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
web_custom_request("process.php",
"URL=http://www.brsbox.com/process.php?s=1&sid=snt0k4hcmi16lngbg2sfpqdep2&uid=2h5321K5a8Y09y20sQ410G&rand=k02950z0m0L21Y15124WyT84g5&1220850475390",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
web_custom_request("process.php_2",
"URL=http://www.brsbox.com/process.php?s=1&sid=snt0k4hcmi16lngbg2sfpqdep2&uid=2h5321K5a8Y09y20sQ410G&rand=k02950z0m0L21Y15124WyT84g5&1220850475578",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t8.inf",
"Mode=HTML",
LAST);
web_custom_request("process.php_3",
"URL=http://www.brsbox.com/process.php?s=1&sid=snt0k4hcmi16lngbg2sfpqdep2&uid=2h5321K5a8Y09y20sQ410G&rand=k02950z0m0L21Y15124WyT84g5&1220850475828",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
web_submit_data("upload.cgi",
"Action=http://file3.brsbox.com/cgi-bin/upload.cgi?
sid=snt0k4hcmi16lngbg2sfpqdep2&uid=2h5321K5a8Y09y20sQ410G
",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t10.inf",
"Mode=HTML",
ITEMDATA,
"Name=file[]", "Value=
F:\\zhouwei\\新建文件夹\\01.txt
", "File=Yes",ENDITEM,
"Name=file[]", "Value=", "File=Yes", ENDITEM,
LAST);
web_custom_request("process.php_4",
"URL=http://www.brsbox.com/process.php?s=1&sid=snt0k4hcmi16lngbg2sfpqdep2&uid=2h5321K5a8Y09y20sQ410G&rand=k02950z0m0L21Y15124WyT84g5&1220850479171",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t11.inf",
"Mode=HTML",
LAST);
web_url("dirid",
"URL=http://www.brsbox.com/filebox/process/s/1/fbid/82752/randstr/k02950z0m0L21Y15124WyT84g5/dirid/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t12.inf",
"Mode=HTML",
EXTRARES,
"Url=/img0.29/ftimg/24/ft_bpdoc.gif", "Referer=http://www.brsbox.com/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/", ENDITEM,
"Url=/img0.29/up.gif", "Referer=http://www.brsbox.com/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/", ENDITEM,
"Url=/img0.29/goto_downpage_blue.gif", "Referer=http://www.brsbox.com/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/", ENDITEM,
"Url=/img0.29/no_save_my_box.gif", "Referer=http://www.brsbox.com/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/", ENDITEM,
"Url=http://log.brsbox.com/__log.gif?rv=1.0&rr=&rh=www.brsbox.com&ru=/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/&rt=BRSBOX%E4%B8%8A%E4%BC%A0%E5%AE%8C%E6%88%90%7CBRSBOX%20%E5%85%8D%E8%B4%B9%E7%BD%91%E7%BB%9C%E7%A1%AC%E7%9B%98&rfl=9.0%20r124&rjvm=1&rlng=zh-cn&rcs=gb2312&rss=1024x768&rsd=32-bit&rg=8195985&rui=journey&ruu=697050534.228394598&ruc=1357659177&rs=566749", "Referer=http://www.brsbox.com/filebox/uploadcomplete/randstr/"
"k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/", ENDITEM,
"Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=1265935515&utmhn=www.brsbox.com&utmcs=gb2312&utmsr=1024x768&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=9.0%20r124&utmdt=BRSBOX%E4%B8%8A%E4%BC%A0%E5%AE%8C%E6%88%90%7CBRSBOX%20%E5%85%8D%E8%B4%B9%E7%BD%91%E7%BB%9C%E7%A1%AC%E7%9B%98&utmhid=614714215&utmr=-&utmp=/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/&utmac=UA-2325498-4&utmcc="
"__utma%3D269387170.3752004810809567000.1220849989.1220850225.1220850428.3%3B%2B__utmz%3D269387170.1220849989.1.1.utmcsr%3Dhi.baidu.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%25b7%25ba%25c2%25dd%2Fblog%2Fitem%2F71f5b0360e8268340a55a928.html%3B", "Referer=http://www.brsbox.com/filebox/uploadcomplete/randstr/k02950z0m0L21Y15124WyT84g5/fgid/590ac2e358eefb48ef1d2916ef73b4df/dirids/", ENDITEM,
LAST);
return 0;
}
[
本帖最后由 小七七 于 2008-9-8 14:57 编辑
]
作者:
iori
时间:
2008-9-8 15:53
我用你的脚本,修改了本地的上传路径,是可以上传成功的,里面的123.txt和02.txt都是我上传的,我的路径是C:\\123.txt,建议不要使用带有中文名称的路径
作者:
shen1936
时间:
2008-9-8 15:54
web_submit_data("upload.cgi",
"Action=http://file3.brsbox.com/cgi-bin/upload.cgi?sid=snt0k4hcmi16lngbg2sfpqdep2&uid=2h5321K5a8Y09y20sQ410G",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/html",
"Referer=http://www.brsbox.com/",
"Snapshot=t10.inf",
"Mode=HTML",
ITEMDATA,
"Name=file[]", "Value={文件路径}: ", "File=Yes",ENDITEM,
"Name=file[]", "Value=", "File=Yes", ENDITEM,
LAST);
================
尝试一下 看看
作者:
小七七
时间:
2008-9-8 20:41
谢谢各位~
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2