51Testing软件测试论坛

标题: LoadRunner回放报“数据类型转化失败”--江湖救济 [打印本页]

作者: xg3396    时间: 2010-5-26 15:25
标题: LoadRunner回放报“数据类型转化失败”--江湖救济
用LoadRunner url协议录制用c#+ajax+json+iis6开发的web程序,只录制登陆,回放时候不能登录,并提示“数据类型转化失败..”江湖救济  主要在404.ASHX 和137.ASHX处报错
代码:

web_url("Login.aspx",
                "URL=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTTP",
                LAST);

        web_concurrent_start(NULL);

        web_url("-1.ashx",
                "URL=http://172.0.31.119:8888/web/Main.BJ/-1.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t2.inf",
                LAST);

        web_url("253.ashx",
                "URL=http://172.0.31.119:8888/web/253.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t3.inf",
                LAST);

        web_url("LoginZm.css",
                "URL=http://172.0.31.119:8888/web/Themes/V0/Css/LoginZm.css",
                "Resource=1",
                "RecContentType=text/css",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t4.inf",
                LAST);

        web_url("520.ashx",
                "URL=http://172.0.31.119:8888/web/520.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t5.inf",
                LAST);

        web_url("234.ashx",
                "URL=http://172.0.31.119:8888/web/234.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t6.inf",
                LAST);

        web_url("110.ashx",
                "URL=http://172.0.31.119:8888/web/110.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t7.inf",
                LAST);

        web_url("369.ashx",
                "URL=http://172.0.31.119:8888/web/369.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t8.inf",
                LAST);

        web_url("404,137.ashx",
                "URL=http://172.0.31.119:8888/web/404,137.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t9.inf",
                LAST);

        web_url("445.ashx",
                "URL=http://172.0.31.119:8888/web/445.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t10.inf",
                LAST);

        web_url("346.ashx",
                "URL=http://172.0.31.119:8888/web/346.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t11.inf",
                LAST);

        web_url("Login.js",
                "URL=http://172.0.31.119:8888/web/Main.BJ/Login.js",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t12.inf",
                LAST);

        web_url("134.ashx",
                "URL=http://172.0.31.119:8888/web/134.ashx",
                "Resource=1",
                "RecContentType=application/x-javascript",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t13.inf",
                LAST);

        web_url("VerifyCode.aspx",
                "URL=http://172.0.31.119:8888/web/SCM/VerifyCode.aspx",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t14.inf",
                LAST);

        web_concurrent_end(NULL);

        web_concurrent_start(NULL);

        web_url("BodyBg.png",
                "URL=http://172.0.31.119:8888/web/Themes/V0/Images/LoginZm/BodyBg.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t15.inf",
                LAST);

        web_url("CancelBg.png",
                "URL=http://172.0.31.119:8888/web/Themes/V0/Images/LoginZm/CancelBg.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t16.inf",
                LAST);

        web_url("LoginBg.png",
                "URL=http://172.0.31.119:8888/web/Themes/V0/Images/LoginZm/LoginBg.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t17.inf",
                LAST);

        web_concurrent_end(NULL);

        lr_think_time(9);

        web_custom_request("404.ashx",
                "URL=http://172.0.31.119:8888/web/404.ashx",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t18.inf",
                "Mode=HTTP",
                "EncType=application/soap+xml; charset=utf-8",
                "Body=[\"WL\",\"123456\",\"\"][]",
                LAST);

        web_custom_request("137.ashx",
                "URL=http://172.0.31.119:8888/web/137.ashx",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://172.0.31.119:8888/web/Main.BJ/Login.aspx",
                "Snapshot=t19.inf",
                "Mode=HTTP",
                "EncType=application/soap+xml; charset=utf-8",
                "Body=[][]",
                LAST);
作者: xg3396    时间: 2010-5-26 15:26
在线等待,自己顶一下
作者: sc_zk2008    时间: 2010-5-26 16:33
你把回放日志的错误信息贴出来
作者: xg3396    时间: 2010-5-26 16:39
回放日志里面没错误, 我是在 lr viewer中看到的,具体错误见附件图片
作者: xg3396    时间: 2010-5-26 16:41
回放时没错误 但是 就是登录不成功
从viewer中看到
“Tsxd.Ajax.Session={};this.value=null;this.error={status:null,statusText:" at Tsxd.Json.CSharpSerialize.SerializeString()\r\n at Tsxd.Json.CSharpSerialize.Serialize(Type type)\r\n at Tsxd.Json.CSharpSerialize.Serialize(String s, Type[] types)\r\n at Tsxd.Json.Converter.ToCSharp(String value, Type type)\r\n at Tsxd.Ajax.HttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)",responseText:"数据转换失败,String类型数据起始字符错误。[]",exception:{"TriggerTime"new Date(1274891827796+(new Date()).getTimezoneOffset()*60000)),"UserName":"","RequestAddress":"172.0.31.85","UserAgent":"Mozilla/4.0 [zh-cn] (compatible; MSIE 7.0; Windows)","Source":"Tsxd.Json","TargetSite":"System.String SerializeString()","Id":1000000000,"Grade":"A","Message":"数据转换失败,String类型数据起始字符错误。[]-------\r ErrorPage:2010-05-26 16:37:07\r-------当前用户Session信息丢失!\r-------httpContext.Request.Url.PathAndQuery:/web/403.ashx\r\r\r","HelpLink":"1000000000","HelpMessage":null,"StackTrace":" at Tsxd.Json.CSharpSerialize.SerializeString()\r\n at Tsxd.Json.CSharpSerialize.Serialize(Type type)\r\n at Tsxd.Json.CSharpSerialize.Serialize(String s, Type[] types)\r\n at Tsxd.Json.Converter.ToCSharp(String value, Type type)\r\n at Tsxd.Ajax.HttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)"}};”
作者: sc_zk2008    时间: 2010-5-26 16:54
回放时没错,vieweR应该显示的是本身系统程序报的错吧,建议先分析下系统程序吧,看看执行到此处,后台报的是什么
作者: xg3396    时间: 2010-5-26 16:55
后台也是 报 数据类型转化失败
作者: 云层    时间: 2010-5-26 17:26
我觉得这是服务器上开发的代码写的不好导致的,你传递过去一个非法值,然后服务器就出错了,说明代码没有做任何错误处理直接引用了,所以这个问题是功能的bug和你没啥关系,你就测试了一个不太正常的数据包而已
作者: xuyingchun-2000    时间: 2010-5-26 17:29
标题: 谢谢
辛苦辛苦!!

[ 本帖最后由 xuyingchun-2000 于 2010-5-26 17:31 编辑 ]
作者: sc_zk2008    时间: 2010-5-27 16:26
同意,还是试试让研发的看看程序吧
作者: xg3396    时间: 2010-5-27 22:46
已经解决了,谢谢解答----lr抓取的包少了东西,用函数加上就成了
作者: xiajianrong    时间: 2010-6-9 10:27
程序有没有做登陆的限制?
比如已经登陆不会再让登陆。

其次你可以其他账户再录制个脚本,看看两个脚本间有什么区别。




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