51Testing软件测试论坛

标题: Discuz论坛,发帖脚本回放不成功,有遇到过的么! [打印本页]

作者: xunni_ing    时间: 2016-3-3 09:29
标题: Discuz论坛,发帖脚本回放不成功,有遇到过的么!

哪位朋友指点一下,不知怎么解决了,也不知道是不是需要关联,我把登录和进入模板事务放在vuser_init中,把发帖事务放在action中,按照小强老师的视频来的,却回放不了,求解,谢谢啊!
作者: xunni_ing    时间: 2016-3-3 09:38
有没有遇到过此问题的啊,谢谢!
作者: maqi5630    时间: 2016-3-3 10:08
错误信息 贴上来呀
作者: jane_fun_hua    时间: 2016-3-3 10:09
回放不成功总有日志信息提示不,根据提示来百度啦~
是否需要关联的话,你要了解你测试对象的数据交互来源,客户端提交的数据是否来源于服务器
作者: xunni_ing    时间: 2016-3-3 10:14
maqi5630 发表于 2016-3-3 10:08
错误信息 贴上来呀

没有错误信心,脚本运行正常,但是论坛里面没有新增一条帖子,在tree下面,提交帖子后,显示“您的请求来路不正确,无法提交。”,也不知什么原因。
作者: xunni_ing    时间: 2016-3-3 10:15
jane_fun_hua 发表于 2016-3-3 10:09
回放不成功总有日志信息提示不,根据提示来百度啦~
是否需要关联的话,你要了解你测试对象的数据交互来 ...

日志显示都是成功的,但论坛中并没哟新增一条帖子,在tree下面,提交帖子后,显示“您的请求来路不正确,无法提交。”,也不知什么原因。
作者: xunni_ing    时间: 2016-3-3 10:19
Action()
{

        lr_start_transaction("发帖");

        web_add_cookie("smile=1D1; DOMAIN=192.168.50.128");

        //lr_think_time(16);

        web_url("post.php",
                "URL=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t7.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=images/common/editor.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/common/bigeditor.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/common/upload.swf?site=http://192.168.50.128/bbs/misc.php%3Ftype=image&type=image", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/common/upload.swf?site=http://192.168.50.128/bbs/misc.php", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/default/notice.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/tongue.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/smile.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/shy.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/titter.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/sad.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/cry.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/biggrin.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/huffy.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/shocked.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/sweat.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/lol.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/mad.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/loveliness.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/funk.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/hug.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/victory.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/handshake.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/curse.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/dizzy.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/kiss.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/sleepy.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/shutup.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/time.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=images/smilies/default/call.gif", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                "Url=pm.php?checknewpm=0.15277351135203188&inajax=1&ajaxtarget=myprompt_check", "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3", ENDITEM,
                LAST);

        web_submit_data("post.php_2",
                "Action=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&extra=&topicsubmit=yes",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://192.168.50.128/bbs/post.php?action=newthread&fid=3&referer=http%3A//192.168.50.128/bbs/forumdisplay.php%3Ffid%3D3",
                "Snapshot=t8.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=formhash", "Value=eac5807e", ENDITEM,
                "Name=posttime", "Value=1456904761", ENDITEM,
                "Name=wysiwyg", "Value=0", ENDITEM,
                "Name=iconid", "Value=", ENDITEM,
                "Name=subject", "Value=hello!", ENDITEM,
                "Name=checkbox", "Value=0", ENDITEM,
                "Name=message", "Value=1111111111!", ENDITEM,
                "Name=tags", "Value=", ENDITEM,
                "Name=addtags", "Value=+可用标签", ENDITEM,
                "Name=attention_add", "Value=1", ENDITEM,
                EXTRARES,
                "Url=images/default/text_zoom.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/fastreply.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/repquote.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/addbuddy.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/edit.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/reply.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/ajaxaction.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/text_common.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/printpost.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                "Url=images/default/pmto.gif", "Referer=http://192.168.50.128/bbs/viewthread.php?tid=31&extra=", ENDITEM,
                LAST);

        lr_end_transaction("发帖",LR_AUTO);

        return 0;
}
作者: sdfgsdgsdg    时间: 2016-3-3 12:26
大部分出现问题都是关联
作者: 远方的小企鹅    时间: 2016-3-3 13:45
xunni_ing 发表于 2016-3-3 10:19
Action()
{

既然是发帖的业务,那发帖完后,是不是应该生成一条唯一的topicID,这个值是动态的,需要关联  ,你找到录制脚本时生成的这个ID,关联它就可以了 LR每次回放都 是模拟真实用户操作,所以回放时会生成一条新的ID
作者: xunni_ing    时间: 2016-3-3 14:10
sdfgsdgsdg 发表于 2016-3-3 12:26
大部分出现问题都是关联

恩恩,好像是,多谢提醒,
作者: xunni_ing    时间: 2016-3-3 14:12
远方的小企鹅 发表于 2016-3-3 13:45
既然是发帖的业务,那发帖完后,是不是应该生成一条唯一的topicID,这个值是动态的,需要关联  ,你找到录 ...

可能我录制的时候有问题,我再试试,多谢,
作者: steven.yang    时间: 2016-3-24 15:28
你脚本里的posttime、formhash都需要做关联




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2