1

我使用 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

4 回答 4

2

更改边界值:尝试:

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

如果它仍然不起作用,请尝试 LR 12 中的 Loadrunner 设计工作室进行自动关联。

于 2015-05-12T11:55:01.640 回答
1

此外,Ordinal=All这意味着您希望找到参数的每一次出现。如果您想要第一次出现,请使用“Ordinal=1”,

于 2016-02-25T09:36:55.490 回答
0

您的左右边框<title> </title>表示您想要标题标签之间的文本,该文本位于<HEAD>HTML 文档的一部分中。同时,您定义搜索过滤器Scope=Body。基本上,您似乎正在寻找<BODY>位于<HEAD>. 尝试删除Scope=Body或将其定义为Scope=All.

于 2013-07-31T08:46:31.297 回答
0

您能否让我们知道包含您尝试通过 web reg save param ex 捕获的值的详细响应?

于 2013-06-30T13:50:56.307 回答