2013-06-30 38 views
1

我使用loadrunner加載測試,想用web_reg_save_param_ex函數獲取參數。但重播沒有得到我想要的值,重播日誌如下,「DEV_PLATFORM \ r \ n」是我想要得到的。爲什麼loadrunner loadrunner web_reg_save_param_ex不起作用

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); 

回答

0

您的左右邊框是<title> </title>,它表示您希望HTML文檔的<HEAD>部分中的標題標籤之間的文本。同時,您可以定義搜索過濾器Scope=Body。基本上,看起來你正在尋找<BODY>內的東西,位於<HEAD>。嘗試刪除Scope=Body或將其定義爲Scope=All

+1

此處更正_Scope_參數。它沒有引用HTML元素,而是引用HTTP Headers或HTTP Body。 **從手冊:** 範圍:在哪裏搜索分隔數據。可選的。 可能的值爲:「全部」 - 搜索整個緩衝區,「標題」 - 僅搜索標題,「正文」 - 僅搜索正文數據,「Cookie」 - 僅在Cookie中搜索 –

0

您能否讓我們知道包含您嘗試捕獲的值的詳細響應?通過web reg save param ex?

1

更改邊界值: 嘗試:

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

如果仍然不行嘗試在LR 12 LoadRunner的設計工作室進行自動關聯。

0

此外,Ordinal=All意味着你想要找到每個參數的發生。如果您想要第一次出現,請使用「Ordinal = 1」,