51Testing软件测试论坛
标题:
回放脚本时怎么不发帖呢?
[打印本页]
作者:
cgdon
时间:
2010-11-15 18:28
标题:
回放脚本时怎么不发帖呢?
刚学Loadrunner,自己搭了个Tomcat,放了个jsp的论坛,刚刚录了个脚本。主要步骤如下:
打开页面-登陆-默认版块-发帖-退出。脚本如下,参数化文件内有200条数据
Action()
{
web_url("sddns2.cncmax.cn:8080",
"URL=http://sddns2.cncmax.cn:8080/?HOST=wpad.router&R=/wpad.dat&",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
// web_add_cookie("smile=1D1; DOMAIN=localhost");
// web_add_cookie("jrun_cookietime=2592000; DOMAIN=localhost");
// web_add_cookie("jrun_sid=I9leLc; DOMAIN=localhost");
web_url("JspRun",
"URL=http://localhost:8080/JspRun",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=/JspRun/forumdata/cache/style_1.css", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/forumdata/cache/style_1_append.css", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/link.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/online.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/menu_itemline.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/arrow_down.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/forumbox_head.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/portalbox_bg.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/wrap_shadow.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/header.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/menubg.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/footer_shadow.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
"Url=/JspRun/images/default/dropmenubg.gif", "Referer=http://localhost:8080/JspRun/", ENDITEM,
LAST);
lr_think_time(7);
web_submit_data("logging.jsp",
"Action=http://localhost:8080/JspRun/logging.jsp?action=login&loginsubmit=true",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:8080/JspRun/",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=formHash", "Value=07fdbc14", ENDITEM,
"Name=cookietime", "Value=2592000", ENDITEM,
"Name=accessing", "Value=logging", ENDITEM,
"Name=loginfield", "Value=username", ENDITEM,
"Name=username", "Value=guest", ENDITEM,
"Name=password", "Value=guest", ENDITEM,
"Name=userlogin", "Value=鐧诲綍", ENDITEM,
LAST);
// web_link("如果您的浏览器没有自动跳转,请点击这里",
// "Text=如果您的浏览器没有自动跳转,请点击这里",
// "Snapshot=t4.inf",
// EXTRARES,
// "Url=forumdata/cache/style_1.css", ENDITEM,
// "Url=forumdata/cache/style_1_append.css", ENDITEM,
// "Url=images/default/link.gif", ENDITEM,
// "Url=images/default/online.gif", ENDITEM,
// "Url=images/default/menu_itemline.gif", ENDITEM,
// "Url=images/default/arrow_down.gif", ENDITEM,
// "Url=images/default/forumbox_head.gif", ENDITEM,
// "Url=images/default/portalbox_bg.gif", ENDITEM,
// "Url=images/default/wrap_shadow.gif", ENDITEM,
// "Url=images/default/header.gif", ENDITEM,
// "Url=images/default/menubg.gif", ENDITEM,
// "Url=images/default/footer_shadow.gif", ENDITEM,
// "Url=images/default/dropmenubg.gif", ENDITEM,
// LAST);
web_link("默认版块",
"Text=默认版块",
"Snapshot=t5.inf",
EXTRARES,
"Url=images/default/folder_s.gif", "Referer=http://localhost:8080/JspRun/forumdisplay.jsp?fid=2", ENDITEM,
"Url=images/default/tradesmall_m.gif", "Referer=http://localhost:8080/JspRun/forumdisplay.jsp?fid=2", ENDITEM,
"Url=images/default/debatesmall_m.gif", "Referer=http://localhost:8080/JspRun/forumdisplay.jsp?fid=2", ENDITEM,
"Url=images/default/arrow_left.gif", "Referer=http://localhost:8080/JspRun/forumdisplay.jsp?fid=2", ENDITEM,
LAST);
web_link("发新话题",
"Text=发新话题",
"Snapshot=t6.inf",
EXTRARES,
"Url=forumdata/cache/smilies_var.js?0.9575768225658263", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/smile.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/lol.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/hug.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/victory.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/time.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/kiss.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/handshake.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/call.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/loveliness.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/mad.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/sweat.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/sad.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/biggrin.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/cry.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/huffy.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
"Url=images/smilies/default/shocked.gif", "Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1", ENDITEM,
LAST);
web_submit_data("post.jsp",
"Action=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&page=&topicsubmit=yes&formHash=04024fcf",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/html",
"Referer=http://localhost:8080/JspRun/post.jsp?action=newthread&fid=2&extra=page%3D1",
"Snapshot=t7.inf",
"Mode=HTML",
ITEMDATA,
"Name=formHash", "Value=04024fcf", ENDITEM,
"Name=isblog", "Value=", ENDITEM,
"Name=frombbs", "Value=1", ENDITEM,
"Name=subject", "Value={topic}", ENDITEM,
"Name=posteditor_mediatyperadio", "Value=on", ENDITEM,
"Name=message", "Value={content}", ENDITEM,
"Name=previewbutton", "Value=预览帖子", ENDITEM,
"Name=tags", "Value=", ENDITEM,
"Name=iconid", "Value=0", ENDITEM,
"Name=wysiwyg", "Value=0", ENDITEM,
EXTRARES,
"Url=images/default/forumlink.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=images/default/buddy_sendpm.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=images/default/user_add.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=images/default/user_online.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=images/default/jpbg.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=images/common/editor.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=forumdata/cache/smilies_var.js?0.7141267974347238", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
"Url=images/default/headactions_line.gif", "Referer=http://localhost:8080/JspRun/viewthread.jsp?tid=4&frombbs=1", ENDITEM,
LAST);
web_link("退出",
"Text=退出",
"Snapshot=t8.inf",
EXTRARES,
"Url=images/default/menulibg.gif", "Referer=http://localhost:8080/JspRun/logging.jsp?action=logout&formhash=DP9HRHUB", ENDITEM,
LAST);
return 0;
}
回放时没有红色的字,但是打开论坛怎么看不到帖子呢?
作者:
cgdon
时间:
2010-11-15 18:30
自己先顶下
作者:
蓝色迷走
时间:
2010-11-16 09:34
1、用户参数化了没?
2、虚拟用户有至少200个吗?
3、一个帖子都看不到吗?
作者:
jj_ljw
时间:
2010-11-16 10:04
回放时迭代2次,论坛能看到帖子不
作者:
androidone
时间:
2010-11-16 11:25
发帖是否有验证码呢?
作者:
sincool
时间:
2010-11-16 14:37
发帖不成功,手工发一个试试,如果成功,则是LR的问题,看是否有验证码,或有发帖间隔时间限制等代码限制条件,我测试BBS的时候就因为这两个问题,或是登陆没成功 等等。。。。压的时候把所有条件限制都去掉
作者:
sincool
时间:
2010-11-16 14:43
[attach]66385[/attach]
回复
1#
androidone
另外建议你在脚本录制的时候选项选择基于URL选项,把图片和文本内容的请求筛选掉
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2