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); 在线等待,自己顶一下 你把回放日志的错误信息贴出来 回放日志里面没错误, 我是在 lr viewer中看到的,具体错误见附件图片 回放时没错误 但是 就是登录不成功
从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 (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)"}};” 回放时没错,vieweR应该显示的是本身系统程序报的错吧,建议先分析下系统程序吧,看看执行到此处,后台报的是什么 后台也是 报 数据类型转化失败 我觉得这是服务器上开发的代码写的不好导致的,你传递过去一个非法值,然后服务器就出错了,说明代码没有做任何错误处理直接引用了,所以这个问题是功能的bug和你没啥关系,你就测试了一个不太正常的数据包而已
谢谢
辛苦辛苦!![ 本帖最后由 xuyingchun-2000 于 2010-5-26 17:31 编辑 ] 同意,还是试试让研发的看看程序吧 已经解决了,谢谢解答----lr抓取的包少了东西,用函数加上就成了 程序有没有做登陆的限制?
比如已经登陆不会再让登陆。
其次你可以其他账户再录制个脚本,看看两个脚本间有什么区别。
页:
[1]