51Testing软件测试论坛

标题: loadrunner脚本回放错误 如何设置设置session关联 [打印本页]

作者: wshxf    时间: 2012-6-11 15:25
标题: loadrunner脚本回放错误 如何设置设置session关联
录制一个登陆页面,脚本如下
vuser_init()
{

               
        web_url("ogc9.wangfenxi.com",
                "URL=http://ogc9.wangfenxi.com/?cookie",
                "Resource=0",
                "Referer=http://192.168.10.158:9000/",
                "Mode=HTML",
                LAST);

        web_url("ogc9.wangfenxi.com_2",
                "URL=http://ogc9.wangfenxi.com/?uid=AH1C35071788&sv=AMZ200912179&FCV=UID-4FD067CC732B9030D4D6A4FB&url=192.168.10.158%3A9000/&ref=bookmark&cpu=Intel%20x86&bz=Microsoft%20Internet%20Explorer&bv=9.0&os=Windows%207&dim=1024*768&cd=24&je=1&jv=13&tz=21&ul=zh-cn&ad_key=&skey=&age=0&gender=unknown&marry=unknown&join=&member_key=&jid=&udf1=&udf2=&udf3=&amt=0&frwd=&pd=&ct=&ll=&RID=0.6001176351878725&",
                "Resource=0",
                "Referer=http://192.168.10.158:9000/",
                "Mode=HTML",
                LAST);

        web_submit_data("check_outchain.php_2",
                "Action=http://qurl.f.360.cn/check_outchain.php",
                "Method=POST",
                "EncType=multipart/form-data",
                "RecContentType=text/xml",
                "Referer=",
                "Snapshot=t15.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=urls", "Value=d9466dd32d586eb2899bf5951cc1f399|5fc4f82e32d98042d9a10f360a855d35|06409663226af2f3114485aa4e0a23b4|8cf10550f44ec4a8e6eaecb422a19295|777409cd656f4792d9905b89cc1b0456\tZGxlYwR2BP4kZP4kAGt=\n", ENDITEM,
                "Name=kws", "Value=", ENDITEM,
                "Name=product", "Value=wd", ENDITEM,
                "Name=combo", "Value=urlproc", ENDITEM,
                "Name=vk", "Value=39ccd379", ENDITEM,
                "Name=src", "Value=addrbar", ENDITEM,
                "Name=mid", "Value=1122b69304415d03d071e6015ae33860", ENDITEM,
                "Name=v", "Value=3", ENDITEM,
                LAST);

        web_submit_data("j_acegi_security_check",
                "Action=http://192.168.10.158:9000/j_acegi_security_check",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://192.168.10.158:9000/",
                "Snapshot=t16.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=merchant_id", "Value=22309696", ENDITEM,
                "Name=j_username", "Value=houxf", ENDITEM,
                "Name=j_password", "Value=123456", ENDITEM,
                "Name=validate_code", "Value=4205", ENDITEM,
                "Name=imageField.x", "Value=24", ENDITEM,
                "Name=imageField.y", "Value=17", ENDITEM,
                EXTRARES,
                LAST);

        web_submit_data("check_outchain.php_3",
                "Action=http://qurl.f.360.cn/check_outchain.php",
                "Method=POST",
                "EncType=multipart/form-data",
                "RecContentType=text/xml",
                "Referer=",
                "Snapshot=t17.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=urls", "Value=5cbecf554d7b5cdca1b2c63a77ce46a2|5fc4f82e32d98042d9a10f360a855d35|06409663226af2f3114485aa4e0a23b4|8cf10550f44ec4a8e6eaecb422a19295|777409cd656f4792d9905b89cc1b0456\tZGxlYwR2BP4kZP4kAGt=\n", ENDITEM,
                "Name=kws", "Value=", ENDITEM,
                "Name=product", "Value=wd", ENDITEM,
                "Name=combo", "Value=urlproc", ENDITEM,
                "Name=vk", "Value=258a337d", ENDITEM,
                "Name=src", "Value=addrbar", ENDITEM,
                "Name=mid", "Value=1122b69304415d03d071e6015ae33860", ENDITEM,
                "Name=v", "Value=3", ENDITEM,
                LAST);

        return 0;
}

回放时,日志提示:
错误 -27791: 服务器“ogc9.wangfenxi.com”已过早关闭连接          [MsgId: MERR-27791]
vuser_init.c(63): 错误 -26000: HTTP header termination, such as \r\n\r\n, not encountered for URL="http://ogc9.wangfenxi.com/?uid=AH1C35071788&sv=AMZ200912179&FCV=UID-4FD067CC732B9030D4D6A4FB&url=192.168.10.158%3A9000/&ref=bookmark&cpu=Intel%20x86&bz=Microsoft%20Internet%20Explorer&bv=9.0&os=Windows%207&dim=1024*768&cd=24&je=1&jv=13&tz=21&ul=zh-cn&ad_key=&skey=&age=0&gender=unknown&marry=unknown&join=&member_key=&jid=&udf1=&udf2=&udf3=&amt=0&frwd=&pd=&ct=&ll=&RID=0.6001176351878725&"          [MsgId: MERR-26000]
vuser_init.c(63): web_url("ogc9.wangfenxi.com_2") 最高严重级别为“ERROR”,0 个正文字节,17 个标头字节          [MsgId: MMSG-26388]
从操作调用了中止。

请问如何改呀,在线等
作者: 云层    时间: 2012-6-11 15:44
有验证码,没办法
作者: msnshow    时间: 2012-6-11 20:10
录制时把360关掉
作者: fangfang0718    时间: 2012-6-13 12:15
关闭后回放没有出错,谢谢啦
作者: shanfeng1419    时间: 2012-6-13 13:47
学习了
作者: qiqiloveyunyun    时间: 2012-6-15 17:19
记住下密码,把测试时间控制在session有效的时间范围内,然后不要录制登陆页面就OK了。欢迎加入测试交流群:229403339,64824774




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