在學習LoadRunner添加檢查點函數時,遇到下面的報錯html
Action.c(135): Error -26366: "Text=checkString" not found for web_reg_find [MsgId: MERR-26366] Action.c(135): web_concurrent_end highest severity level was "ERROR", 2354 body bytes, 478 header bytes [MsgId: MMSG-26388]
出現緣由是檢查點函數位置寫的不對。在LoadRunner中,含有reg的函數能夠稱爲註冊函數,這種類型函數的特色是在使用時,要放在實際請求提交以前。
初始錄製腳本爲:web
web_submit_data("login.pl", "Action=http://127.0.0.1:1080/WebTours/login.pl", "Method=POST", "RecContentType=text/html", "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home", "Snapshot=t9.inf", "Mode=HTTP", ITEMDATA, "Name=userSession", "Value=126807.596597813zfcczzfpHfDQVDfpQQtf", ENDITEM, "Name=username", "Value=test1", ENDITEM, "Name=password", "Value=111111", ENDITEM, "Name=JSFormSubmit", "Value=off", ENDITEM, "Name=login.x", "Value=36", ENDITEM, "Name=login.y", "Value=5", ENDITEM, LAST); web_url("login.pl_2", "URL=http://127.0.0.1:1080/WebTours/login.pl?intro=true", "Resource=0", "RecContentType=text/html", "Referer=http://127.0.0.1:1080/WebTours/login.pl", "Snapshot=t15.inf", "Mode=HTTP", LAST); web_reg_find("Text=test1",LAST);
此時,由於檢查點函數放在請求提交以後,因此回放時出現上面提到的報錯。修改腳本以下:函數
web_reg_find("Text=test1",LAST); web_submit_data("login.pl", "Action=http://127.0.0.1:1080/WebTours/login.pl", "Method=POST", "RecContentType=text/html", "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home", "Snapshot=t9.inf", "Mode=HTTP", ITEMDATA, "Name=userSession", "Value=126807.596597813zfcczzfpHfDQVDfpQQtf", ENDITEM, "Name=username", "Value=test1", ENDITEM, "Name=password", "Value=111111", ENDITEM, "Name=JSFormSubmit", "Value=off", ENDITEM, "Name=login.x", "Value=36", ENDITEM, "Name=login.y", "Value=5", ENDITEM, LAST); web_url("login.pl_2", "URL=http://127.0.0.1:1080/WebTours/login.pl?intro=true", "Resource=0", "RecContentType=text/html", "Referer=http://127.0.0.1:1080/WebTours/login.pl", "Snapshot=t15.inf", "Mode=HTTP", LAST);
運行修改後的腳本,顯示成功信息。學習
Action.c(95): Registering web_reg_find was successful [MsgId: MMSG-26390]