哈库拉玛塔塔——tjitty

记录下网络上的精品测试技术文章 and 生活

统计

留言簿(8)

积分与排名

阅读排行榜

评论排行榜

几个很实用的函数

Correlating Statements Functions

Click one of the following functions for more information:

Saves data from a static or received buffer to a parameter.
Saves data from a static, received, or user buffer to a parameter.
Searches for an occurrence of strings in a static or received buffer and saves a portion of the buffer, relative to the string occurrence, to a parameter.

Sets a timeout for receiving the expected data on a socket.
Sets a second timeout for receiving data on a socket.

posted on 2008-03-21 10:31 tjitty 阅读(837) 评论(3)  编辑 收藏 引用 所属分类: LoadRunner

评论

# re: 几个很实用的函数 2008-03-21 10:35 tjitty

http://bbs.51testing.com/viewthread.php?tid=80801

  回复  更多评论   

# re: 几个很实用的函数 2008-03-21 10:49 tjitty

Sockets协议中有3个用于关联的函数,分别是lrs_save_param、lrs_save_param_ex和lrs_save_searched_string。

前两个函数都是根据偏移量和查找的数据的长度来定位所需要的数据,所以只适合于返回内容基本固定,只是所需要的数据动态变化,而且长度不变的情况,在本次测试中并不适用。

第三个函数是根据左右边界来定位要查找的数据,正是我所需要的。

lrs_save_searched_string与web协议中的web_reg_save_param函数作用基本一样,所不同的只是web_reg_save_param要放在需要关联的请求前,而lrs_save_searched_string是放在请求后。

具体使用方法就看LR的帮助吧。
  回复  更多评论   

# re: 几个很实用的函数 2008-03-21 10:57 tjitty

在并发情况下,经常会出现返回数据比较大的buffer接收不到,由于做了动态关联,没有接收到数据就导致关联失败,从而导致vuser fail掉。

我们先开始以为是lrs_set_recv_timeout2设的太短,可是设为120秒情况依旧。仔细看了下lrs_receive的帮助才发现原来还有一个超时时间的设置,这个超时是从发出请求后等待返回数据的时间,使用lrs_set_recv_timeout进行设置,默认同样为10秒。把这个超时时间改为120秒,问题马上就消失了。  回复  更多评论   

只有注册用户登录后才能发表评论。