1. 程式人生 > >loadrunner回放時報Error -26377(web_reg_save_param)

loadrunner回放時報Error -26377(web_reg_save_param)

搞了大半天,終於能正常通過web_reg_save_param獲取到自己想要的返回值了。

網上說了好多辦法,但是對我都沒用,我的辦法是先用web_reg_save_param函式獲取所有響應body體內容,然後根據返回的結果設定LB、RB值。

獲取整個響應body體方法。

web_reg_save_param("ResponseBody",

"LB=",

"RB=",

"Search=Body",LAST);//獲取所有的responsebody值。

如果使用LR11,使用web_reg_save_param_ex函式更好些。

web_reg_save_param_ex(

“ParamName=temp”,

"LB=",

"RB=",

"Ordinal=1",

SEARCH_FILTERS,

"ContentType=text/html",

LAST);

示例:比如說從WEB頁面上看返回值為userid:10,username:十,那麼如果想獲取到userid的值:10方法如下:

方法一:通過返回頁面上格式設定LB和RB,這樣做一直是報錯,後來就嘗試了方法二。

web_reg_save_param_ex(

“ParamName=userid”,

"LB=userid:",

"RB=,username",

"Ordinal=1",

SEARCH_FILTERS,

"ContentType=text/html",

LAST);

方法二:通過在日誌中檢視整個響應BODY體,來設定LB、RB。

web_reg_save_param_ex(

“ParamName=userid”,

"LB=\nuserid:",

"RB=,\nusername",

"Ordinal=1",

SEARCH_FILTERS,

"ContentType=text/html",

LAST);

上述兩種方法可以看出,方法二變數前邊都多個換行符\n,我也不知道為什麼這樣就沒問題,但是檢視body體中變數前確實都加了\n,這樣設定就不報錯了。

其它人的解決方法通常如下,供大家參考。

Error -26377
web_set_max_html_param_len("1024");


Action.c(56): Error -26377: No match found for the requested parameter "returncodeVar". Check whether the requested boundaries exist in the response data. 
Also, if the data you want to save exceeds 4096 bytes, use web_set_max_html_param_len to increase the parameter size
經測試發現...
web_set_max_html_param_len("1024");語句應該寫在web_reg_save_param()之前,例如:
    web_set_max_html_param_len("1024");
    web_reg_save_param("returncodeVar",
        "LB={\"returncode\":\"",
        "RB=\"}",
        "Ord=1",
        LAST);
如果指令碼中多次用到web_reg_save_param()應該每處都加上這句web_set_max_html_param_len()
辦法一不能解決的情況下,
解決辦法如下:
設定runt time setting中的internet protocol-preferences中的advaced區域有一個winlnet replay instead of sockets選項,選項後再回放就成功了! 

Error -27740
Action.c(5): Error -27740: Overlapped transmission of request to "192.168.4.177" for URL "http://192.168.4.177:8080/" failed: WSA_IO_PENDING
http://blog.csdn.net/zeeslo/article/details/1938160
Troubleshooting 
Add the following statement to the beginning of the script to disable the breakdown of the "First Buffer" into server and network time: web_set_sockets_option("OVERLAPPED_SEND", "0");
Error -27727
Action.c(5): Error -27727: Step download timeout (180 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively

一、Step download timeout (120 seconds)

這是一個經常會遇到的問題,解決得辦法走以下步驟:

1、修改run time setting中的請求超時時間,增加到600s,其中有三項的引數可以一次都修改了,HTTP-request connect timeoutHTTP-request receieve timeoutStep download timeout,分別建議修改為6006005000run time setting設定完了後記住還需要在control元件的optionrun time setting中設定相應的引數。

2、辦法一不能解決的情況下,解決辦法如下:

設定runt time setting中的internet protocol-preferences中的advaced區域有一個winlnet replay instead of sockets選項,選項後再回放就成功了。切記此法只對windows系統起作用,此法來自zee的資料。

Error -27796
Action.c(5): Error -27796: Failed to connect to server "192.168.4.177:8080": [10060] Connection timed out

Error -27791
Action.c(5): Error -27791: Server "192.168.4.177" has shut down the connection prematurely

Error -27728
Action.c(5): Error -27728: Step download timeout (180 seconds) has expired


Abnormal termination, caused by mdrv process termination.

Error -27496: Internal Error - InternetCloseHandle failed for item at 0C678FF8, Windows error code=6. Assuming the item can be deleted, but error(s) may occur in fvLrwNetWinInetCallback

Action.c(23): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://www.xxxx.com/"

Error -26499: Internal Error - Granulated Transaction_UserDataPoint("HTTP_200", 1) failed, rc=-1

Action.c(23): Error -26377: No match found for the requested parameter "hotelId". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 1024 bytes, use web_set_max_html_param_len to increase the parameter size

Action.c(23): Error -26374: The above "not found" error(s) may be explained by header and body byte counts being 0 and 0, respectively.

Action.c(64): Error: C interpreter run time error: Action.c (64):  Error -- memory violation : Exception ACCESS_VIOLATION received.
LR中在winsocket下解決10053錯誤
http://haotesting.blogbus.com/logs/33921729.html
http://bbs.51testing.com/thread-478927-1-1.html?/index
http://www.51testing.com/?60038/action_viewspace_itemid_3786.html