51Testing软件测试论坛

标题: 录制脚本时的问题 [打印本页]

作者: smilesun666    时间: 2007-5-18 22:58
标题: 录制脚本时的问题
在录制脚本时,出现提示框中显示如下信息:

Step was not added error is step arguments
作者: shanxi    时间: 2007-5-19 00:31
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);
作者: shanxi    时间: 2007-5-19 00:32
转义字符
\
作者: smilesun666    时间: 2007-5-19 12:01
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
点击确定,出现关联要求对话框:点击确定。然后重复出现关联提示,我就重复点击确定,要关联。。。这样也完成了录制功能。。

这样的步骤对吗?
在回放脚本时
作者: smilesun666    时间: 2007-5-19 12:22
标题: 继续
的testresult页面中action步骤中有一个url操作,点击左边的树时,右边报"object error"提示;


这种问题怎么解决
作者: happyphenix    时间: 2007-5-21 08:05
在script里的任意一行都可以加入参数?然后显示:
        web_reg_save_param("fruit",
                "LB=apple",
                "RB=",
                LAST);

:双引号要加转义字符\
作者: duola1119    时间: 2007-5-21 08:54
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);




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2