为什么loadrunner loadrunner web_reg_save_param_ex不起作用

时间:2013-06-30 05:40:14

标签: loadrunner

我使用loadrunner加载测试,想用web_reg_save_param_ex函数获取参数。但重播没有得到我想要的价值,重播日志如下,“DEV_PLATFORM \ r \ n”是我想要的。

Starting iteration 1.
Starting action Action.
Action.c(3): web_set_max_html_param_len started     [MsgId: MMSG-26355]
Action.c(3): web_set_max_html_param_len was successful      [MsgId: MMSG-26392]
Action.c(5): web_reg_save_param_ex started      [MsgId: MMSG-26355]
Action.c(5): Registering web_reg_save_param_ex was successful   [MsgId: MMSG-26390]
Action.c(14): web_add_cookie started    [MsgId: MMSG-26355]
Action.c(14): web_add_cookie was successful     [MsgId: MMSG-26392]
Action.c(16): web_url("rdms") started   [MsgId: MMSG-26355]
Action.c(16): t=59673ms: Connecting [0] to host server:8080     [MsgId: MMSG-26000]
Action.c(16): t=59684ms: Connected socket [0] from 192.168.1.89:1288 to server:8080 in 2 ms     [MsgId: MMSG-26000]
Action.c(16): t=59691ms: 364-byte request headers for "http://www.mansuo.com/rdms" (RelFrameId=1, Internal ID=1)
Action.c(16):     GET /rdms HTTP/1.1\r\n
Action.c(16):     User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; 
Action.c(16):     .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)\r\n
Action.c(16):     Accept-Encoding: gzip, deflate\r\n
Action.c(16):     Accept-Language: zh-cn\r\n
Action.c(16):     Accept: */*\r\n
Action.c(16):     Connection: Keep-Alive\r\n
Action.c(16):     Host: server:8080\r\n
Action.c(16):     Cookie: com.mansuo.base.product.ProductCode=Portal\r\n
Action.c(16):     \r\n
Action.c(16): t=59802ms: 168-byte response headers for "http://www.mansuo.com/rdms" (RelFrameId=1, Internal ID=1)
Action.c(16):     HTTP/1.1 302 Moved Temporarily\r\n
Action.c(16):     Location: http://www.mansuo.com/rdms/\r\n
Action.c(16):     Transfer-Encoding: chunked\r\n
Action.c(16):     Date: Sun, 30 Jun 2013 05:13:08 GMT\r\n
Action.c(16):     Server: Apache-Coyote/1.1\r\n
Action.c(16):     \r\n
Action.c(16): t=59951ms: 5-byte chunked response overhead for "http://www.mansuo.com/rdms" (RelFrameId=1, Internal ID=1)
Action.c(16):     0\r\n
Action.c(16):     \r\n
Action.c(16): Redirecting "http://www.mansuo.com/rdms" (redirection depth is 0)     [MsgId: MMSG-26694]
Action.c(16): To location "http://www.mansuo.com/rdms/"     [MsgId: MMSG-26693]
Action.c(16): t=59993ms: Request done "http://www.mansuo.com/rdms"      [MsgId: MMSG-26000]
Action.c(16): t=60021ms: Connecting [1] to host server:8080     [MsgId: MMSG-26000]
Action.c(16): t=60029ms: Connected socket [1] from 192.168.1.89:1289 to server:8080 in 1 ms     [MsgId: MMSG-26000]
Action.c(16): t=60037ms: 365-byte request headers for "http://www.mansuo.com/rdms/" (RelFrameId=1, Internal ID=2)
Action.c(16):     GET /rdms/ HTTP/1.1\r\n
Action.c(16):     User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; 
Action.c(16):     .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)\r\n
Action.c(16):     Accept-Encoding: gzip, deflate\r\n
Action.c(16):     Accept-Language: zh-cn\r\n
Action.c(16):     Accept: */*\r\n
Action.c(16):     Connection: Keep-Alive\r\n
Action.c(16):     Host: server:8080\r\n
Action.c(16):     Cookie: com.mansuo.base.product.ProductCode=Portal\r\n
Action.c(16):     \r\n
Action.c(16): t=60134ms: 295-byte response headers for "http://www.mansuo.com/rdms/" (RelFrameId=1, Internal ID=2)
Action.c(16):     HTTP/1.1 200 OK\r\n
Action.c(16):     Pragma: No-cache\r\n
Action.c(16):     Cache-Control: no-cache\r\n
Action.c(16):     Expires: Thu, 01 Jan 1970 00:00:00 GMT\r\n
Action.c(16):     Set-Cookie: JSESSIONID=E43A3FDEF770917EB3AFC7FB548A914A; Path=/rdms\r\n
Action.c(16):     Content-Type: text/html;charset=UTF-8\r\n
Action.c(16):     Content-Length: 310\r\n
Action.c(16):     Date: Sun, 30 Jun 2013 05:13:08 GMT\r\n
Action.c(16):     Server: Apache-Coyote/1.1\r\n
Action.c(16):     \r\n
Action.c(16): Conversion from "utf-8" (code page 65001, preferred charset=utf-8, Unicode converter name="utf-8") will be performed for response of URL="http://www.mansuo.com/rdms/"    [MsgId: MMSG-35184]
Action.c(16): t=60251ms: 301-byte response body for "http://www.mansuo.com/rdms/" (RelFrameId=1, Internal ID=2)
Action.c(16):     \r\n
Action.c(16):     \r\n
Action.c(16):     \r\n
Action.c(16):     \r\n
Action.c(16):     \r\n
Action.c(16):     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r\n
Action.c(16):     <html>\r\n
Action.c(16):     <head>\r\n
Action.c(16):     <title>DEV_PLATFORM</title>\r\n
Action.c(16):     <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />\r\n
Action.c(16):     </head>\r\n
Action.c(16):     \r\n
Action.c(16):     <body>\r\n
Action.c(16):     <script language="JavaScript">\r\n
Action.c(16):     location="login.jsp";\r\n
Action.c(16):     </script>\r\n
Action.c(16):     </body>\r\n
Action.c(16):     </html>\r\n
Action.c(16): t=60525ms: Request done "http://www.mansuo.com/rdms/"     [MsgId: MMSG-26000]
Action.c(16): Error -26377: No match found for the requested parameter "newParam". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 1000000 bytes, use web_set_max_html_param_len to increase the parameter size   [MsgId: MERR-26377]
Action.c(16): Notify: Saving Parameter "newParam_count = 0".
Action.c(16): web_url("rdms") highest severity level was "ERROR", 310 body bytes, 463 header bytes, 5 chunking overhead bytes   [MsgId: MMSG-26387]
Ending action Action.
Ending iteration 1.

我的脚本如下,为什么web_reg_save_param_ex不起作用?为什么脚本没有获得“DEV_PLATFORM”值?

web_set_max_html_param_len("1000000");

web_reg_save_param_ex("ParamName=newParam", 
        "LB/IC=     <title>", 
        "RB/IC=</title>\r\n", 
        "Ordinal=all",  
        SEARCH_FILTERS, 
            "Scope=body",
        LAST);


web_add_cookie("com.mansuo.base.product.ProductCode=Portal; DOMAIN=192.168.1.86");

web_url("rdms", 
    "URL=http://192.168.1.86:8080/rdms", 
    "Resource=0", 
    "RecContentType=text/html", 
    "Referer=", 
    "Snapshot=t108.inf", 
    "Mode=HTTP", 
    LAST);

4 个答案:

答案 0 :(得分:2)

更改边界值: 试试:

web_reg_save_param_ex("ParamName=newParam", 
        "LB/IC=<title>", 
        "RB/IC=</title>", 
        "Ordinal=all",  
        SEARCH_FILTERS, 
        "Scope=body",
        LAST);

如果仍然无效,请尝试使用LR 12中的Loadrunner design studio进行自动关联。

答案 1 :(得分:1)

此外,Ordinal=All表示您希望找到参数的每个出现位置。如果您想要第一次出现,请使用“Ordinal = 1”,

答案 2 :(得分:0)

请您告诉我们详细的回复,其中包含您试图通过网络注册保存参数来捕获的价值?

答案 3 :(得分:0)

您的左右边框为<title> </title>,表示您希望标题标记位于HTML文档的<HEAD>部分之间。同时,您可以定义搜索过滤器Scope=Body。基本上,您似乎正在<BODY>内搜索位于<HEAD>的内容。请尝试删除Scope=Body或将其定义为Scope=All