51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1868|回复: 6
打印 上一主题 下一主题

[原创] 录制脚本时的问题

[复制链接]
  • TA的每日心情
    奋斗
    2015-8-4 09:44
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2007-5-18 22:58:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    在录制脚本时,出现提示框中显示如下信息:

    Step was not added error is step arguments
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    该用户从未签到

    2#
    发表于 2007-5-19 00:31:36 | 只看该作者
    Diagnosis: While trying to add left and right boundaries in a web_reg_save_param statement using the Insert menu, the special characters are not escaped, unlike in LoadRunner 7.5.

    Example:
    1. Open a Web script.
    2. Right-click -> Insert -> New Step -> web_reg_save_param.
    3. Type in any string with special characters for "Left boundary" or "Right boundary."

       Example:
       value = "apple" name ="fruit"

    The line is added without any escape characters added for the quotes, which will eventually cause the script to fail.

    Note:
    This is a known issue.



    --------------------------------------------------------------------------------

    Solution: Add convert_to_c_format=1

    From Loadrunner 7.51 onwards, do the following:
    1. Close VuGen.
    2. Go to <%WinDir%>\vugen.ini and edit the file with notepad.
    3. Add the key convert_to_c_format=1 under the [WebRecorder] section of vugen.ini.
    4. Launch VuGen and try the same steps again.

    Note:
    The behavior of not escaping special characters is default by definition. The reason is that there are all kinds of pitfalls when trying to understand what a user wants to escape in a string and what not.
    Example:

    If 7875 is to be captured from the string Value_"\item\"value?7875? , then VuGen puts the function as:

    web_reg_save_param("param",
         "LB=Value_\"\\item\\"value?",
         "RB=?",
         LAST);

    In other words, VuGen does not know whether the second " is already escaped or not. So the user needs to add the extra \ on his own as shown below:

    web_reg_save_param("param",
         "LB=Value_\"\\item\\\"value?",
         "RB=?",
         LAST);
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    3#
    发表于 2007-5-19 00:32:56 | 只看该作者
    转义字符
    \
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2015-8-4 09:44
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    4#
     楼主| 发表于 2007-5-19 12:01:38 | 只看该作者
    value = "apple" name ="fruit"
    上面的Left boundary="apple"
    在script里的任意一行都可以加入参数?然后显示:
            web_reg_save_param("fruit",
                    "LB=apple",
                    "RB=",
                    LAST);
    然后运行vugen;到了这段就停下来了。。

    其实,具体的录制时的情况是:
    出现提示框中显示如下信息:

    Step was not added error is step arguments
    点击确定,出现关联要求对话框:点击确定。然后重复出现关联提示,我就重复点击确定,要关联。。。这样也完成了录制功能。。

    这样的步骤对吗?
    在回放脚本时
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2015-8-4 09:44
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    5#
     楼主| 发表于 2007-5-19 12:22:05 | 只看该作者

    继续

    的testresult页面中action步骤中有一个url操作,点击左边的树时,右边报"object error"提示;


    这种问题怎么解决
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    6#
    发表于 2007-5-21 08:05:25 | 只看该作者
    在script里的任意一行都可以加入参数?然后显示:
            web_reg_save_param("fruit",
                    "LB=apple",
                    "RB=",
                    LAST);

    :双引号要加转义字符\
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    7#
    发表于 2007-5-21 08:54:41 | 只看该作者
    1.web_reg_save_param()函数不是放在哪个位置都可以的.
    要将这个函数放到从SERVER获取数据处的下方.
    2.LR中含有一些特殊字符是不能直接用来定义函数的左右边界的.这些特殊符号需要使用\转意字符.转意一下.
    你的问题就是说你web_reg_save_param()函数的左右边界没有取好.
    例如你的代码:value="apple" name="fruit"
    如果你想取这个fruit的话,可以这样写
    web_reg_save_param("fruit",
    "LB=value=\"apple name=\"",
    "RB=\"",
    "Search=ALL",
    LAST);
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-10-8 08:30 , Processed in 0.107171 second(s), 28 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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