录制时关联为什么不好使?
大家好!我使用的LoadRunner版本是LR11.在VuGen的Tools-Recording Options中勾选了"Enable correlation during recording",创建了录制时关联的Application和Rule.我测试的就是自带的WebTours程序。其中一个订票的web_url函数,用Tree视图的HTTP View,看到Response Body是:
<!--
User has returned to the search page.Since user has already logged on,
we can give them the menu in the navbar.
--->
<html>
<title>Web Tours</title>
<!-- Frame Set -->
<frameset cols="160,*" border=1 frameborder=1>
<!-- Navigation Frame -->
<frame src=nav.pl?page=menu&in=flights name=navbar
marginheight=2 marginwidth=2 noresize scrolling=auto>
<!-- Reservation Frame -->
<frame src=reservations.pl?page=welcome name=info
marginheight=2 marginwidth=2 noresize scrolling=auto>
</frameset>
如上的红色文字是我自己标红的,我就想关联这段文字测试一下。于是我创建了规则:
我又创建了另一个规则:
服务器每个返回HTML的Response中,都有title标签,我觉得肯定会生成很多关联函数。
然后我开始录制脚本,结果是这样的:
第一个规则(关联文本"page=welcome")的规则,在第一次录制后,确实生成了关联函数web_reg_save_param:
reservation()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 163
// {WCSParam6} = "page=welcome"
// */
web_reg_save_param("WCSParam6",
"LB/IC=<frame src=reservations.pl?",
"RB/IC= name=info",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
lr_think_time(30);
web_url("welcome.pl",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
而第二个规则(关联title标签中内容的规则),却没有生成任何关联函数。
然后我又开始重新录制脚本,结果两个规则都无法生成关联函数了!
reservation()
{
lr_think_time(36);
web_url("welcome.pl",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
这是为什么呢?谢谢大家!
“服务器每个返回HTML的Response中,都有title标签,我觉得肯定会生成很多关联函数。”---不要自己想
把服务器返回值打出来然后再分析为什么没关联上
首先要确认服务器返回值是否有titile virgolong 发表于 2016-9-17 22:44
“服务器每个返回HTML的Response中,都有title标签,我觉得肯定会生成很多关联函数。”---不要自己想
把服 ...
//Response Body1
<HTML>
<HEAD>
<title>Web Tours</title>
<frameset rows = "65,*" border=1 bordercolor=#E0E7F1>
<frame name="header" src=header.html scrolling=no noresize marginheight=2 marginwidth=2>
<frame name="body" src=welcome.pl?signOff=true scrolling=auto noresize marginheight=2 marginwidth=2>
</frameset>
</head>
</html>
//Response Body2
<!--
User has returned to the search page.Since user has already logged on,
we can give them the menu in the navbar.
--->
<html>
<title>Web Tours</title>
<!-- Frame Set -->
<frameset cols="160,*" border=1 frameborder=1>
<!-- Navigation Frame -->
<frame src=nav.pl?page=menu&in=flights name=navbar
marginheight=2 marginwidth=2 noresize scrolling=auto>
<!-- Reservation Frame -->
<frame src=reservations.pl?page=welcome name=info
marginheight=2 marginwidth=2 noresize scrolling=auto>
</frameset>
//Response Body3
<!--
User has returned to the home page.Since user has already logged on,
we can give them the menu in the navbar.
--->
<html>
<title>Web Tours</title>
<!-- Frame Set -->
<frameset cols="160,*" border=1 frameborder=1>
<!-- Navigation Frame -->
<frame src=nav.pl?page=menu&in=home name=navbar
marginheight=2 marginwidth=2 noresize scrolling=auto>
<!-- Intro Frame -->
<frame src=login.pl?intro=true name=info
marginheight=2 marginwidth=2 noresize scrolling=auto>
</frameset>
如上是服务器3个Response的Body,都有title标签,其中第二个Response Body也满足我设的第一条关联规则。都没有生成关联函数,不知道是为什么:(
页:
[1]