性能測試學習第八天_腳本編寫


設置關聯

打開測試服務器,在http://localhost:1080/WebTours/頁面點擊administration,勾選set login form‘s action tag to an error page。用於分配動態session id

之后錄制登錄退出的腳本,進行驗證回放,發現回放失敗了

提示需要設置關聯,所以我們在腳本關聯結果中,進行錄制快照中的文本與回放快照中的文本進行關聯,如下圖

關聯之后的腳本如下

Action()
{

//Correlation comment - Do not change!Original value='36533009' Name ='CorrelationParameter_1'

    web_reg_save_param_ex(
        "ParamName=CorrelationParameter_1",
        "LB=118546.0",
        "RB=z",
        SEARCH_FILTERS,
        "Scope=Body",
        "RequestUrl=*/nav.pl*",
        LAST);

//Correlation comment - Do not change!Original value='VVpHftVzzzH' Name ='CorrelationParameter_2'

    web_reg_save_param_ex(
        "ParamName=CorrelationParameter_2",
        "LB=H",
        "RB=D",
        SEARCH_FILTERS,
        "Scope=Body",
        "RequestUrl=*/nav.pl*",
        LAST);

//Correlation comment - Do not change!Original value='Afcf' Name ='CorrelationParameter_3'

    web_reg_save_param_ex(
        "ParamName=CorrelationParameter_3",
        "LB=H",
        "RB=>\n<table border",
        SEARCH_FILTERS,
        "Scope=Body",
        "RequestUrl=*/nav.pl*",
        LAST);

    web_url("WebTours",
        "URL=http://localhost:1080/WebTours/",
        "Resource=0",
        "RecContentType=text/html",
        "Referer=",
        "Snapshot=t2.inf",
        "Mode=HTML",
        LAST);

    lr_think_time(9);

    web_submit_data("login.pl",
        "Action=http://localhost:1080/WebTours/login.pl",
        "Method=POST",
        "RecContentType=text/html",
        "Referer=http://localhost:1080/WebTours/nav.pl?in=home",
        "Snapshot=t3.inf",
        "Mode=HTML",
        ITEMDATA,
        "Name=userSession", "Value=118546.0{CorrelationParameter_1}zAQHH{CorrelationParameter_2}DzfizpcH{CorrelationParameter_3}", ENDITEM,
        "Name=username", "Value=jojo", ENDITEM,
        "Name=password", "Value=bean", ENDITEM,
        "Name=JSFormSubmit", "Value=on", ENDITEM,
        "Name=login.x", "Value=46", ENDITEM,
        "Name=login.y", "Value=14", ENDITEM,
        LAST);

    web_image("SignOff Button",
        "Alt=SignOff Button",
        "Snapshot=t4.inf",
        LAST);

return 0;
}

html錄制模式和url錄制模式

1.html模式錄制的腳本

Action()
{
    web_url("WebTours", 
        "URL=http://localhost:1080/WebTours/", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        LAST);

    lr_think_time(11);

    web_submit_form("login.pl", 
        "Snapshot=t3.inf", 
        ITEMDATA, 
        "Name=username", "Value=jojo", ENDITEM, 
        "Name=password", "Value=bean", ENDITEM, 
        "Name=login.x", "Value=83", ENDITEM, 
        "Name=login.y", "Value=9", ENDITEM, 
        LAST);

    web_image("Search Flights Button", 
        "Alt=Search Flights Button", 
        "Snapshot=t4.inf", 
        LAST);

    lr_think_time(9);

    web_submit_form("reservations.pl", 
        "Snapshot=t5.inf", 
        ITEMDATA, 
        "Name=depart", "Value=London", ENDITEM, 
        "Name=departDate", "Value=05/18/2016", ENDITEM, 
        "Name=arrive", "Value=Paris", ENDITEM, 
        "Name=returnDate", "Value=05/19/2016", ENDITEM, 
        "Name=numPassengers", "Value=2", ENDITEM, 
        "Name=roundtrip", "Value=<OFF>", ENDITEM, 
        "Name=seatPref", "Value=None", ENDITEM, 
        "Name=seatType", "Value=Coach", ENDITEM, 
        "Name=findFlights.x", "Value=9", ENDITEM, 
        "Name=findFlights.y", "Value=11", ENDITEM, 
        LAST);

    web_submit_form("reservations.pl_2", 
        "Snapshot=t6.inf", 
        ITEMDATA, 
        "Name=outboundFlight", "Value=240;108;05/18/2016", ENDITEM, 
        "Name=reserveFlights.x", "Value=58", ENDITEM, 
        "Name=reserveFlights.y", "Value=3", ENDITEM, 
        LAST);

    web_submit_form("reservations.pl_3", 
        "Snapshot=t7.inf", 
        ITEMDATA, 
        "Name=firstName", "Value=Joseph", ENDITEM, 
        "Name=lastName", "Value=Marshall", ENDITEM, 
        "Name=address1", "Value=234 Willow Drive", ENDITEM, 
        "Name=address2", "Value=San Jose/CA/94085", ENDITEM, 
        "Name=pass1", "Value=Joseph Marshall", ENDITEM, 
        "Name=pass2", "Value=", ENDITEM, 
        "Name=creditCard", "Value=", ENDITEM, 
        "Name=expDate", "Value=", ENDITEM, 
        "Name=saveCC", "Value=<OFF>", ENDITEM, 
        "Name=buyFlights.x", "Value=36", ENDITEM, 
        "Name=buyFlights.y", "Value=8", ENDITEM, 
        LAST);

    lr_think_time(5);

    web_image("Itinerary Button", 
        "Alt=Itinerary Button", 
        "Snapshot=t8.inf", 
        LAST);

    web_image("SignOff Button", 
        "Alt=SignOff Button", 
        "Snapshot=t9.inf", 
        LAST);

    return 0;
}

2.url模式錄制的腳本

Action()
{
    web_url("WebTours", 
        "URL=http://localhost:1080/WebTours/", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=", 
        "Snapshot=t2.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_start(NULL);

    web_url("header.html", 
        "URL=http://localhost:1080/WebTours/header.html", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/", 
        "Snapshot=t3.inf", 
        "Mode=HTTP", 
        LAST);

    web_url("welcome.pl", 
        "URL=http://localhost:1080/WebTours/welcome.pl?signOff=true", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/", 
        "Snapshot=t6.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_end(NULL);

    web_concurrent_start(NULL);

    web_url("hp_logo.png", 
        "URL=http://localhost:1080/WebTours/images/hp_logo.png", 
        "Resource=1", 
        "RecContentType=image/png", 
        "Referer=http://localhost:1080/WebTours/header.html", 
        "Snapshot=t4.inf", 
        LAST);

    web_url("webtours.png", 
        "URL=http://localhost:1080/WebTours/images/webtours.png", 
        "Resource=1", 
        "RecContentType=image/png", 
        "Referer=http://localhost:1080/WebTours/header.html", 
        "Snapshot=t5.inf", 
        LAST);

    web_concurrent_end(NULL);

    web_concurrent_start(NULL);

    web_url("home.html", 
        "URL=http://localhost:1080/WebTours/home.html", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/welcome.pl?signOff=true", 
        "Snapshot=t7.inf", 
        "Mode=HTTP", 
        LAST);

    web_url("nav.pl", 
        "URL=http://localhost:1080/WebTours/nav.pl?in=home", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/welcome.pl?signOff=true", 
        "Snapshot=t8.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_end(NULL);

    web_url("mer_login.gif", 
        "URL=http://localhost:1080/WebTours/images/mer_login.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?in=home", 
        "Snapshot=t9.inf", 
        LAST);

    lr_think_time(12);

    web_submit_data("login.pl", 
        "Action=http://localhost:1080/WebTours/login.pl", 
        "Method=POST", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/nav.pl?in=home", 
        "Snapshot=t10.inf", 
        "Mode=HTTP", 
        ITEMDATA, 
        "Name=userSession", "Value=118546.109518023zAQHHVfpfAiDDDDDDzfizpcQDAf", ENDITEM, 
        "Name=username", "Value=jojo", ENDITEM, 
        "Name=password", "Value=bean", ENDITEM, 
        "Name=JSFormSubmit", "Value=off", ENDITEM, 
        "Name=login.x", "Value=68", ENDITEM, 
        "Name=login.y", "Value=15", ENDITEM, 
        LAST);

    web_concurrent_start(NULL);

    web_url("nav.pl_2", 
        "URL=http://localhost:1080/WebTours/nav.pl?page=menu&in=home", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/login.pl", 
        "Snapshot=t11.inf", 
        "Mode=HTTP", 
        LAST);

    web_url("login.pl_2", 
        "URL=http://localhost:1080/WebTours/login.pl?intro=true", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/login.pl", 
        "Snapshot=t15.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_end(NULL);

    web_concurrent_start(NULL);

    web_url("flights.gif", 
        "URL=http://localhost:1080/WebTours/images/flights.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=home", 
        "Snapshot=t12.inf", 
        LAST);

    web_url("in_home.gif", 
        "URL=http://localhost:1080/WebTours/images/in_home.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=home", 
        "Snapshot=t13.inf", 
        LAST);

    web_url("itinerary.gif", 
        "URL=http://localhost:1080/WebTours/images/itinerary.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=home", 
        "Snapshot=t14.inf", 
        LAST);

    web_url("signoff.gif", 
        "URL=http://localhost:1080/WebTours/images/signoff.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=home", 
        "Snapshot=t16.inf", 
        LAST);

    web_concurrent_end(NULL);

    web_url("Search Flights Button", 
        "URL=http://localhost:1080/WebTours/welcome.pl?page=search", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=home", 
        "Snapshot=t17.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_start(NULL);

    web_url("nav.pl_3", 
        "URL=http://localhost:1080/WebTours/nav.pl?page=menu&in=flights", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/welcome.pl?page=search", 
        "Snapshot=t18.inf", 
        "Mode=HTTP", 
        LAST);

    web_url("reservations.pl", 
        "URL=http://localhost:1080/WebTours/reservations.pl?page=welcome", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/welcome.pl?page=search", 
        "Snapshot=t19.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_end(NULL);

    web_concurrent_start(NULL);

    web_url("in_flights.gif", 
        "URL=http://localhost:1080/WebTours/images/in_flights.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=flights", 
        "Snapshot=t20.inf", 
        LAST);

    web_url("home.gif", 
        "URL=http://localhost:1080/WebTours/images/home.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=flights", 
        "Snapshot=t21.inf", 
        LAST);

    web_concurrent_end(NULL);

    web_url("button_next.gif", 
        "URL=http://localhost:1080/WebTours/images/button_next.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/reservations.pl?page=welcome", 
        "Snapshot=t22.inf", 
        LAST);

    lr_think_time(9);

    web_submit_data("reservations.pl_2", 
        "Action=http://localhost:1080/WebTours/reservations.pl", 
        "Method=POST", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/reservations.pl?page=welcome", 
        "Snapshot=t23.inf", 
        "Mode=HTTP", 
        ITEMDATA, 
        "Name=advanceDiscount", "Value=0", ENDITEM, 
        "Name=depart", "Value=London", ENDITEM, 
        "Name=departDate", "Value=05/18/2016", ENDITEM, 
        "Name=arrive", "Value=Paris", ENDITEM, 
        "Name=returnDate", "Value=05/19/2016", ENDITEM, 
        "Name=numPassengers", "Value=2", ENDITEM, 
        "Name=seatPref", "Value=None", ENDITEM, 
        "Name=seatType", "Value=Coach", ENDITEM, 
        "Name=.cgifields", "Value=roundtrip", ENDITEM, 
        "Name=.cgifields", "Value=seatType", ENDITEM, 
        "Name=.cgifields", "Value=seatPref", ENDITEM, 
        "Name=findFlights.x", "Value=46", ENDITEM, 
        "Name=findFlights.y", "Value=10", ENDITEM, 
        LAST);

    web_submit_data("reservations.pl_3", 
        "Action=http://localhost:1080/WebTours/reservations.pl", 
        "Method=POST", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/reservations.pl", 
        "Snapshot=t24.inf", 
        "Mode=HTTP", 
        ITEMDATA, 
        "Name=outboundFlight", "Value=240;108;05/18/2016", ENDITEM, 
        "Name=numPassengers", "Value=2", ENDITEM, 
        "Name=advanceDiscount", "Value=0", ENDITEM, 
        "Name=seatType", "Value=Coach", ENDITEM, 
        "Name=seatPref", "Value=None", ENDITEM, 
        "Name=reserveFlights.x", "Value=36", ENDITEM, 
        "Name=reserveFlights.y", "Value=12", ENDITEM, 
        LAST);

    web_submit_data("reservations.pl_4", 
        "Action=http://localhost:1080/WebTours/reservations.pl", 
        "Method=POST", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/reservations.pl", 
        "Snapshot=t25.inf", 
        "Mode=HTTP", 
        ITEMDATA, 
        "Name=firstName", "Value=Joseph", ENDITEM, 
        "Name=lastName", "Value=Marshall", ENDITEM, 
        "Name=address1", "Value=234 Willow Drive", ENDITEM, 
        "Name=address2", "Value=San Jose/CA/94085", ENDITEM, 
        "Name=pass1", "Value=Joseph Marshall", ENDITEM, 
        "Name=pass2", "Value=", ENDITEM, 
        "Name=creditCard", "Value=", ENDITEM, 
        "Name=expDate", "Value=", ENDITEM, 
        "Name=oldCCOption", "Value=", ENDITEM, 
        "Name=numPassengers", "Value=2", ENDITEM, 
        "Name=seatType", "Value=Coach", ENDITEM, 
        "Name=seatPref", "Value=None", ENDITEM, 
        "Name=outboundFlight", "Value=240;108;05/18/2016", ENDITEM, 
        "Name=advanceDiscount", "Value=0", ENDITEM, 
        "Name=returnFlight", "Value=", ENDITEM, 
        "Name=JSFormSubmit", "Value=off", ENDITEM, 
        "Name=.cgifields", "Value=saveCC", ENDITEM, 
        "Name=buyFlights.x", "Value=28", ENDITEM, 
        "Name=buyFlights.y", "Value=6", ENDITEM, 
        LAST);

    web_url("bookanother.gif", 
        "URL=http://localhost:1080/WebTours/images/bookanother.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/reservations.pl", 
        "Snapshot=t26.inf", 
        LAST);

    web_url("Itinerary Button", 
        "URL=http://localhost:1080/WebTours/welcome.pl?page=itinerary", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=flights", 
        "Snapshot=t27.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_start(NULL);

    web_url("itinerary.pl", 
        "URL=http://localhost:1080/WebTours/itinerary.pl", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/welcome.pl?page=itinerary", 
        "Snapshot=t28.inf", 
        "Mode=HTTP", 
        LAST);

    web_url("nav.pl_4", 
        "URL=http://localhost:1080/WebTours/nav.pl?page=menu&in=itinerary", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/welcome.pl?page=itinerary", 
        "Snapshot=t29.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_end(NULL);

    web_url("in_itinerary.gif", 
        "URL=http://localhost:1080/WebTours/images/in_itinerary.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=itinerary", 
        "Snapshot=t30.inf", 
        LAST);

    web_concurrent_start(NULL);

    web_url("cancelreservation.gif", 
        "URL=http://localhost:1080/WebTours/images/cancelreservation.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/itinerary.pl", 
        "Snapshot=t31.inf", 
        LAST);

    web_url("cancelallreservations.gif", 
        "URL=http://localhost:1080/WebTours/images/cancelallreservations.gif", 
        "Resource=1", 
        "RecContentType=image/gif", 
        "Referer=http://localhost:1080/WebTours/itinerary.pl", 
        "Snapshot=t32.inf", 
        LAST);

    web_concurrent_end(NULL);

    web_url("SignOff Button", 
        "URL=http://localhost:1080/WebTours/welcome.pl?signOff=1", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=itinerary", 
        "Snapshot=t33.inf", 
        "Mode=HTTP", 
        LAST);

    web_concurrent_start(NULL); //並發記錄 web_url("home.html_2", "URL=http://localhost:1080/WebTours/home.html", "Resource=0", "RecContentType=text/html", "Referer=http://localhost:1080/WebTours/welcome.pl?signOff=1", "Snapshot=t34.inf", "Mode=HTTP", LAST); web_url("nav.pl_5", "URL=http://localhost:1080/WebTours/nav.pl?in=home", "Resource=0", "RecContentType=text/html", "Referer=http://localhost:1080/WebTours/welcome.pl?signOff=1", "Snapshot=t35.inf", "Mode=HTTP", LAST); web_concurrent_end(NULL); //並發執行 return 0;
}

添加事務(Transaction)

事務定義:事務是一個點,我們為了衡量某個操作的性能,在操作的開始和結束位置插入這樣一個范圍,即定義了一個transaction

添加事務原因:從性能測試角度出發,要知道不同操作所花費的時間,就用到了事務,我們在操作之前插入一個事務開始標識,在操作完成后插入一個事務結束標識,這樣我們就知道這個操作所花費的時間。

事物的作用:LR運行到該事務開始點時開始計時,直到運行到該事務的結束點,計時結束。這個事務的運行時間會在LR的運行結果中反映。即,事務是一個計時標志。通常事務時間所反映的是一個操作過程的響應時間。

事務的函數構造:添加事務可以 插入-開始事務(Ctrl+T)/結束事務(Ctrl+D),或者點擊

lr_start_transaction("login");

    web_url("WebTours", 
        "URL=http://localhost:1080/WebTours/", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        LAST);

    lr_end_transaction("login", LR_AUTO);

其中LR_AUTO:自動返回檢測到的狀態

運行結果:

Action.c(6): 在 HTML“http://localhost:1080/WebTours/nav.pl?in=home”中找到資源“http://localhost:1080/WebTours/images/mer_login.gif”      [MsgId: MMSG-26659]
Action.c(6): web_url("WebTours") 已成功,6449 個正文字節,1608 個標頭字節      [MsgId: MMSG-26386]
Action.c(15): 通知: 事務 "login""Pass" 狀態結束 (持續時間: 7.1189 浪費的時間: 3.3532)。
Action.c(19): 將表單提交到“http://localhost:1080/WebTours/login.pl”,目標幀=“body”      [MsgId: MMSG-27978]

Duration表示事務的完成響應時間,wasted time包括事務中函數自身執行所消耗的時間

參數化設置

參數化詳解可以參考,寫的很詳細http://www.cnblogs.com/fnng/archive/2012/06/22/2558900.html

http://www.cnblogs.com/candle806/archive/2011/07/18/2109607.html

1.參數化之間的關聯

主要用於用戶名和密碼的對應,如果,我們已經對用戶名進行了參數化username,如果讓用戶名和密碼進行對應,則需要設置密碼參數和用戶名關聯

之后選擇123456右鍵選擇替換為參數,參數名稱為passwd,選擇右下角屬性

從文件路徑下,選擇剛剛創建的username.dat,然后添加列,點擊用記事本編輯,輸入對應的密碼,保存后頁面如下

關閉后,點擊完成,即完成了用戶名和密碼的參數化與對應

腳本設置完參數化,腳本運行的每一遍所取的參數化的值都不一樣,那么這個值按照個什么情況來取呢?會有很多種方式

Select next row【選擇下一行】:

順序(Sequential):按照參數化的數據順序,一個一個的來取。

隨機(Random):參數化中的數據,每次隨機的從中抽取數據。

唯一(Unique):為每個虛擬用戶分配一條唯一的數據

 

Update value on【更新時的值】: 

每次迭代(Each iteration) :每次迭代時取新的值,假如50個用戶都取第一條數據,稱為一次迭代;完了50個用戶都取第二條數據,后面以此類推。

每次出現(Each occurrence):每次參數時取新的值,這里強調前后兩次取值不能相同。

只取一次(once) :參數化中的數據,一條數據只能被抽取一次。(如果數據輪次完,腳本還在運行將會報錯)

 

內容檢查

勾選運行時設置下首選項中的 啟用圖像和文本檢查

錄制完腳本后 任務->內容檢查,會顯示腳本快照,選擇一個要檢查的頁面,右鍵點擊添加文本檢查

如圖可以看出添加檢查點的函數為web_reg_find

確定后,腳本中添加了如下內容

web_reg_find("Search=Body",
        "Text=Find Flight",
        LAST);

 

日志解析

1.回放日志

2.錄制日志

3.生成日志

錯誤處理函數

運行時設置(F4)

VuGen提供了錯誤處理函數void lr_continue_on_error(int value);

value是腳本運行時出錯設置的取值,具體取值及相應含義如下表:

在使用表中參數時,常量名和常量值都可以作為參數

常量名稱 常量值 含義
LR_ON_ERROR_NO_OPTIONS 0 取消出錯繼續執行設置
LR_ON_ERROR_CONTINUE 1 發生錯誤繼續運行腳本
LR_ON_ERROR_SKIP_TO_NEXT_ACTION 2 發生錯誤跳至下個Action運行
LR_ON_ERROR_SKIP_TO_NEXT_ITERATION 3 發生錯誤跳至下個迭代運行
LR_ON_ERROR_END_VUSER 4 發生錯誤結束當前用戶

 

 

 

 

 

常用的是0和1,通常成對使用,適合壓力較大且在夜間自動運行的測試場景,這類場景通常會在運行時設置中開啟出現錯誤時仍繼續選項

關鍵業務發生錯誤時需停止執行,通過lr_continue_on_error(0)實現

非關鍵業務發生錯誤時無需停止運行,通過lr_continue_on_error(1)實現

移動APP腳本錄制

安裝一個LR11 Patch4補丁,為了協議中有mobile app這個協議

之后,電腦和手機一個網段

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM