51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1674|回复: 1
打印 上一主题 下一主题

[原创] 请教几个录制脚本的问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-10-21 18:36:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
初学loadrunner,感觉很迷茫,希望高手能指点一二

1.loadrunner的录制脚本的原理机制到底是怎么样的?

  看到网上有说是通过获取数据包解析成函数,那么在日志里是否可以看到获取数据包的日志,录制脚本的正确性是否应该根据获取的数据 包 来判断,如何判断呢,能否举个例子

2.该如何选择协议,我测试的系统是Spring+dwr的,选择协议web(http/html),html_base_script,录的过程有一个步骤计算量十分大,计算结果是ajax获取的。时间很慢,为什么录出来的脚本回放十分快,录的脚本基本上是
web_custom_request("LoginBO.login.dwr",
  "URL=http://localhost:9080/TEST/dwr/call/plaincall/LoginBO.login.dwr",
  "Method=POST",
  "Resource=0",
  "RecContentType=text/javascript",
  "Referer=http://localhost:9080/TEST/",
  "Snapshot=t382.inf",
  "Mode=HTML",
  "EncType=text/plain",
  "Body=callCount=1\n"
  "page=/TEST/\n"
  "httpSessionId=0000iT8QNpvdMWSgkKo4Vp2YWjd:-1\n"
  "scriptSessionId=A882B97F4922E8FB333CBB67970B1991707\n"
  "c0-scriptName=LoginBO\n"
  "c0-methodName=login\n"
  "c0-id=0\n"
  "c0-e1=string:super\n"
  "c0-param0=Object_Object:{staff_name:reference:c0-e1}\n"
  "batchId=0\n",
  LAST);

web_custom_request("ModelConditionConfigBO.try_count.dwr",
  "URL=http://localhost:9080/TEST/dwr/call/plaincall/ModelConditionConfigBO.try_count.dwr",
  "Method=POST",
  "Resource=0",
  "RecContentType=text/javascript",
  "Referer=http://localhost:9080/TEST/jsp/adm/cltm/group_condition.jsp?localId=28&dataPeriod=200906",
  "Snapshot=t165.inf",
  "Mode=HTML",
  "EncType=text/plain",
  "Body=callCount=1\npage=/TEST/jsp/adm/cltm/group_condition.jsp?localId=28&dataPeriod=200906\nhttpSessionId=0000-7jcPW7FkHhJqBQPbJvDNc7:-1\nscriptSessionId=1BBC57C6D894E6A354193156F6ACBAE2917\nc0-scriptName=ModelConditionConfigBO\nc0-methodName=try_count\nc0-id=0\nc0-e2=string:2001\nc0-e3=string:lower(CUST_NAME)%20not%20like%20'5'\nc0-e4=string:%E5%AE%A2%E6%88%B7%E5%90%8D%E7%A7%B0%20%E4%B8%8D%E7%AD%89%E4%BA%8E%205\nc0-e5=string:1\nc0-e6=string:2001\nc0-e7=string:F_CUST_INFO_\nc0-e8=string:1\nc0-e9="
  "string:1\nc0-e10=string:CUST_NAME\nc0-e11=null:null\nc0-e1=Object_Object:{id:reference:c0-e2, condition:reference:c0-e3, visual_condition:reference:c0-e4, con_type:reference:c0-e5, virtual_column_id:reference:c0-e6, prefix_seg_table_name:reference:c0-e7, key_level_code:reference:c0-e8, segtable_type_code:reference:c0-e9, column_name:reference:c0-e10, data_type:reference:c0-e11}\nc0-e13=string:2000\nc0-e14=string:lower(CUST_ID)%20not%20like%20'6'\nc0-e15=string"
  ":%E5%AE%A2%E6%88%B7%E7%BC%96%E7%A0%81%20%E4%B8%8D%E7%AD%89%E4%BA%8E%206\nc0-e16=string:1\nc0-e17=string:2000\nc0-e18=string:F_CUST_INFO_\nc0-e19=string:1\nc0-e20=string:1\nc0-e21=string:CUST_ID\nc0-e22=null:null\nc0-e12=Object_Object:{id:reference:c0-e13, condition:reference:c0-e14, visual_condition:reference:c0-e15, con_type:reference:c0-e16, virtual_column_id:reference:c0-e17, prefix_seg_table_name:reference:c0-e18, key_level_code:reference:c0-e19, segtable_type_code:reference:c0-e20, "
  "column_name:reference:c0-e21, data_type:reference:c0-e22}\nc0-e24=string:2007\nc0-e25=string:lower(CONTACT_ADDR)%20like%20'7'\nc0-e26=string:%E8%81%94%E7%B3%BB%E5%9C%B0%E5%9D%80%20%E7%AD%89%E4%BA%8E%207\nc0-e27=string:1\nc0-e28=string:2007\nc0-e29=string:F_CUST_INFO_\nc0-e30=string:1\nc0-e31=string:1\nc0-e32=string:CONTACT_ADDR\nc0-e33=null:null\nc0-e23=Object_Object:{id:reference:c0-e24, condition:reference:c0-e25, visual_condition:reference:c0-e26, con_type:reference:c0-e27, virtual_column_id"
  ":reference:c0-e28, prefix_seg_table_name:reference:c0-e29, key_level_code:reference:c0-e30, segtable_type_code:reference:c0-e31, column_name:reference:c0-e32, data_type:reference:c0-e33}\nc0-e35=string:11000\nc0-e36=string:lower(CUST_ID)%20like%20'5%25'\nc0-e37=string:%E5%AE%A2%E6%88%B7%E6%A0%87%E8%AF%86%20%E4%BB%A5%205%20%E5%BC%80%E5%A4%B4%20\nc0-e38=string:1\nc0-e39=string:11000\nc0-e40=string:F_ACCT_CUST_\nc0-e41=string:1\nc0-e42=string:1\nc0-e43=string:CUST_ID\nc0-e44=null:null\nc0-e34="
  "Object_Object:{id:reference:c0-e35, condition:reference:c0-e36, visual_condition:reference:c0-e37, con_type:reference:c0-e38, virtual_column_id:reference:c0-e39, prefix_seg_table_name:reference:c0-e40, key_level_code:reference:c0-e41, segtable_type_code:reference:c0-e42, column_name:reference:c0-e43, data_type:reference:c0-e44}\nc0-e46=string:11004\nc0-e47=string:MB_IN_AREA_CNT%20%3C%205\nc0-e48=string:%E5%AE%A2%E6%88%B7%E5%8C%BA%E5%86%85%E6%AC%A1%E6%95%B0%20%E5%B0%8F%E4%BA%8E%205\nc0-e49=string"
  ":1\nc0-e50=string:11004\nc0-e51=string:F_ACCT_CUST_\nc0-e52=string:1\nc0-e53=string:1\nc0-e54=string:MB_IN_AREA_CNT\nc0-e55=null:null\nc0-e45=Object_Object:{id:reference:c0-e46, condition:reference:c0-e47, visual_condition:reference:c0-e48, con_type:reference:c0-e49, virtual_column_id:reference:c0-e50, prefix_seg_table_name:reference:c0-e51, key_level_code:reference:c0-e52, segtable_type_code:reference:c0-e53, column_name:reference:c0-e54, data_type:reference:c0-e55}\nc0-param0=Array:[reference"
  ":c0-e1,reference:c0-e12,reference:c0-e23,reference:c0-e34,reference:c0-e45]\nc0-param1=string:1\nc0-param2=string:28\nc0-param3=number:200906\nbatchId=0\n",
  LAST);
是不是因为AJAX的原因所以录出来的脚本是这样的,脚本是正确的吗?这个函数是不是没有录到具体的过程?感觉很不理解,望高人指点

3.脚本中关联到底需不需要,CTRL+F8找不出关联的地方,我登陆的时候sessionId都没有做关联,脚本回放也没有发生错误,这是为什么呢


非常迷茫。。望各位高手指点
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2009-10-22 10:21:10 | 只看该作者
只能回答第三个问题,自动关联在很多情况下是不能做到完全关联的,需要自己查找需要关联的地方。
脚本回放没发生错误是因为你没有加验证点,你可以单步调试,看看每步执行时的页面都是什么,会有发现的~
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-15 22:31 , Processed in 0.067586 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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