服務:惠普自帶平臺
操作步驟:
一、登錄
1、事務開始(login)
2、輸入賬號密碼,點擊登錄
3、增加檢查點“Welcome, jojo,”
4、事務結束(login)
二、退出
5、事務開始(signoff)
6、點擊signoff退出登錄
7、增加檢查點“Welcome to the Web Tours site.”
8、事務結束(signoff)
以下是錄製關聯後的腳本:
Action()
{
web_reg_save_param_ex(
"ParamName=CorrelationParameter_1",
"LB=userSession value=",
"RB=>",
SEARCH_FILTERS,
"Scope=Body",
"IgnoreRedirections=Yes",
"RequestUrl=*/nav.pl*",
LAST);
web_url("WebTours",
"URL=http://192.168.43.171:1080/WebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"URL=http://www.bing.com/favicon.ico", ENDITEM,
LAST);
lr_start_transaction("login");
web_reg_find("Text=Welcome, <b>jojo</b>,",
LAST);
lr_think_time(21);
web_submit_data("login.pl",
"Action=http://192.168.43.171:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://192.168.43.171:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={CorrelationParameter_1}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=32", ENDITEM,
"Name=login.y", "Value=5", ENDITEM,
LAST);
lr_end_transaction("login", LR_AUTO);
lr_start_transaction("signoff");
web_reg_find("Text=Welcome to the Web Tours site.",
LAST);
lr_think_time(54);
web_url("SignOff Button",
"URL=http://192.168.43.171:1080/WebTours/welcome.pl?signOff=1",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.43.171:1080/WebTours/nav.pl?page=menu&in=home",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
lr_end_transaction("signoff", LR_AUTO);
return 0;
}