51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 1625|回复: 3
打印 上一主题 下一主题

[求助] 录制时关联为什么不好使?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2016-9-15 23:02:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
大家好!我使用的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);


这是为什么呢?谢谢大家!

本帖子中包含更多资源

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

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

使用道具 举报

  • TA的每日心情
    开心
    2015-9-22 15:26
  • 签到天数: 16 天

    连续签到: 1 天

    [LV.4]测试营长

    2#
    发表于 2016-9-17 22:44:45 | 只看该作者
    “服务器每个返回HTML的Response中,都有title标签,我觉得肯定会生成很多关联函数。”---不要自己想
    把服务器返回值打出来  然后再分析为什么没关联上
    首先要确认服务器返回值是否有titile

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 积极回复获得测试积点10

    查看全部评分

    回复 支持 反对

    使用道具 举报

    该用户从未签到

    3#
     楼主| 发表于 2016-9-25 18:48:28 | 只看该作者
    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 下一条

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

    GMT+8, 2024-5-7 04:07 , Processed in 0.068262 second(s), 24 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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