51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3030|回复: 11
打印 上一主题 下一主题

[求助] LoadRunner回放报“数据类型转化失败”--江湖救济

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-5-26 15:25:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
用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);

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2010-5-26 15:26:45 | 只看该作者
在线等待,自己顶一下
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2010-5-26 16:33:34 | 只看该作者
你把回放日志的错误信息贴出来
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2010-5-26 16:39:21 | 只看该作者
回放日志里面没错误, 我是在 lr viewer中看到的,具体错误见附件图片
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2010-5-26 16:41:09 | 只看该作者
回放时没错误 但是 就是登录不成功
从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)"}};”
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2010-5-26 16:54:20 | 只看该作者
回放时没错,vieweR应该显示的是本身系统程序报的错吧,建议先分析下系统程序吧,看看执行到此处,后台报的是什么
回复 支持 反对

使用道具 举报

该用户从未签到

7#
 楼主| 发表于 2010-5-26 16:55:31 | 只看该作者
后台也是 报 数据类型转化失败
回复 支持 反对

使用道具 举报

该用户从未签到

8#
发表于 2010-5-26 17:26:30 | 只看该作者
我觉得这是服务器上开发的代码写的不好导致的,你传递过去一个非法值,然后服务器就出错了,说明代码没有做任何错误处理直接引用了,所以这个问题是功能的bug和你没啥关系,你就测试了一个不太正常的数据包而已
回复 支持 反对

使用道具 举报

该用户从未签到

9#
发表于 2010-5-26 17:29:22 | 只看该作者

谢谢

辛苦辛苦!!

[ 本帖最后由 xuyingchun-2000 于 2010-5-26 17:31 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

10#
发表于 2010-5-27 16:26:55 | 只看该作者
同意,还是试试让研发的看看程序吧
回复 支持 反对

使用道具 举报

该用户从未签到

11#
 楼主| 发表于 2010-5-27 22:46:14 | 只看该作者
已经解决了,谢谢解答----lr抓取的包少了东西,用函数加上就成了
回复 支持 反对

使用道具 举报

该用户从未签到

12#
发表于 2010-6-9 10:27:46 | 只看该作者
程序有没有做登陆的限制?
比如已经登陆不会再让登陆。

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

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-20 14:58 , Processed in 0.111865 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表