LoadRunner????:????????????????
????????? ???????[ 2017/4/5 13:57:23 ] ?????????????????? LoadRunner
????2?????????
??????????????????????????????????????????????????????????????????????????????й????????????????????????????????????????????н????????????????????????????????????????Σ??????????????Ч?????????????????????????????????????????????????????????????????????
?????????к?vuser->scan script for correlations???????????????????????????correlate????????????????????????????????????????????????????????7?????
????
?7???????????
???????????????????????web_reg_param????????????????????????£????????????error-35061?????????????????????????
Action()
{
web_url("WebTours"??
"URL=http://127.0.0.1:1080/WebTours"??
"Resource=0"??
"RecContentType=text/html"??
"Referer="??
"Snapshot=t1.inf"??
"Mode=HTTP"??
LAST);
web_url("header.html"??
"URL=http://127.0.0.1:1080/WebTours/header.html"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t2.inf"??
"Mode=HTTP"??
LAST);
web_url("webtours.png"??
"URL=http://127.0.0.1:1080/WebTours/images/webtours.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/header.html"??
"Snapshot=t4.inf"??
LAST);
web_url("hp_logo.png"??
"URL=http://127.0.0.1:1080/WebTours/images/hp_logo.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/header.html"??
"Snapshot=t5.inf"??
LAST);
web_url("welcome.pl"??
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t6.inf"??
"Mode=HTTP"??
LAST);
web_concurrent_start(NULL);
web_url("home.html"??
"URL=http://127.0.0.1:1080/WebTours/home.html"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"??
"Snapshot=t7.inf"??
"Mode=HTTP"??
LAST);
//????????????web_reg_save_param_ex????????????????????????????
//Correlation comment - Do not change!Original value='120705.370676387zcAiHicpfAtVzzzHDHcfcpzQfAcf' Name ='CorrelationParameter_1'
web_reg_save_param_ex(//?????????????web_reg_save_param???????????
"ParamName=CorrelationParameter_1"??//?????????????????????в????????????浽?????????
"LB=userSession value="??//?????
"RB=>
<table border"??//?????
SEARCH_FILTERS??//????????????????????????
"Scope=Body"??
//"RequestUrl=*/nav.pl*"?? /*???????error-35061???????????????????????????е??????*/
LAST);//???????????
web_url("nav.pl"??
"URL=http://127.0.0.1:1080/WebTours/nav.pl?in=home"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"??
"Snapshot=t8.inf"??
"Mode=HTTP"??
LAST);
web_concurrent_end(NULL);
web_url("mer_login.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/mer_login.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home"??
"Snapshot=t9.inf"??
LAST);
web_concurrent_start(NULL);
web_url("8afc2fe48db9060fe1bdda2089e1d950.png"??
"URL=http://act.cmcmcdn.com/upload/201507/8afc2fe48db9060fe1bdda2089e1d950.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t11.inf"??
LAST);
web_url("3b491068507d8f85ea7b35d756da7215.png"??
"URL=http://act.cmcmcdn.com/upload/201507/3b491068507d8f85ea7b35d756da7215.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t12.inf"??
LAST);
web_concurrent_end(NULL);
lr_start_transaction("???");
lr_think_time(6);
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=t15.inf"??
"Mode=HTTP"??
ITEMDATA??
//??CorrelationParameter_1???????泣??????value????????????
"Name=userSession"?? "Value={CorrelationParameter_1}"?? ENDITEM??
"Name=username"?? "Value=test1"?? ENDITEM??
"Name=password"?? "Value=test1"?? ENDITEM??//password?????????????????? "PASS";??????????????"FAIL"
"Name=JSFormSubmit"?? "Value=off"?? ENDITEM??
"Name=login.x"?? "Value=0"?? ENDITEM??
"Name=login.y"?? "Value=0"?? ENDITEM??
LAST);
web_concurrent_start(NULL);
//???λ?ò??????
web_reg_find("Text=test1"??
"SaveCount=num"??//?????num??????????test1
"Search=Body"??
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=t16.inf"??
"Mode=HTTP"??
LAST);
web_url("nav.pl_2"??
"URL=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/login.pl"??
"Snapshot=t17.inf"??
"Mode=HTTP"??
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("flights.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/flights.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t18.inf"??
LAST);
web_url("itinerary.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/itinerary.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t19.inf"??
LAST);
web_url("signoff.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/signoff.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t20.inf"??
LAST);
web_url("in_home.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/in_home.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t21.inf"??
LAST);
web_concurrent_end(NULL);
//?ж??????????
if(atoi(lr_eval_string("{num}"))>=1){//?ж????num????????????????????????????1
lr_end_transaction("???"?? LR_PASS);//???????????????????????????????LR_PASS
}
else{
lr_end_transaction("???"?? LR_FAIL);//????????LR_FAIL
}
return 0;
}
????3?????????
??????????????????????????????????????????????????????????????????????????????LR??????????????й????????????????????????????????????????????????£?
????1??????????????????????????????????????
????2?????WinDiff?????????????????????????????????WinDiff??LR???????????????tools->compare with vuser????????????????????????????б???????WinDiff??????в???????????????????????????????????????????lr_think_time????????????????????
????3?????????????????????
????4?????web_reg_save_param?????????????????????????????????????λ??????vuser->run-time settings->general->log->extended log?????????????????С???replay log?????windiff?б?????????????????????д???????????????????????λ??????8?????
????
?8??????????????λ???
????5????????е?ù??????????????????????web_reg_save_param???????????????????ò???????????е?????????9?????
??????????????????£????????????error-27216???????????????????????????????
Action()
{
web_url("WebTours"??
"URL=http://127.0.0.1:1080/WebTours"??
"Resource=0"??
"RecContentType=text/html"??
"Referer="??
"Snapshot=t2.inf"??
"Mode=HTTP"??
LAST);
web_url("header.html"??
"URL=http://127.0.0.1:1080/WebTours/header.html"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t3.inf"??
"Mode=HTTP"??
LAST);
web_url("hp_logo.png"??
"URL=http://127.0.0.1:1080/WebTours/images/hp_logo.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/header.html"??
"Snapshot=t5.inf"??
LAST);
web_url("welcome.pl"??
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t6.inf"??
"Mode=HTTP"??
LAST);
web_url("webtours.png"??
"URL=http://127.0.0.1:1080/WebTours/images/webtours.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/header.html"??
"Snapshot=t7.inf"??
LAST);
web_url("home.html"??
"URL=http://127.0.0.1:1080/WebTours/home.html"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"??
"Snapshot=t11.inf"??
"Mode=HTTP"??
LAST);
//?????????д??????????????????б???(error-27216)
//web_reg_save_param("BL"??
// "LB=userSession value="??
// "RB=>"??
// "Search=Body"??
// LAST);
//???????????????2??????????????????г????????????ò????????????????
web_reg_save_param("BL"??//????????BL
"LB=userSession value="??
"RB=>"??
"Search=Body"??
LAST);
web_url("nav.pl"??
"URL=http://127.0.0.1:1080/WebTours/nav.pl?in=home"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"??
"Snapshot=t12.inf"??
"Mode=HTTP"??
LAST);
web_url("mer_login.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/mer_login.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home"??
"Snapshot=t13.inf"??
LAST);
web_concurrent_start(NULL);
web_url("8afc2fe48db9060fe1bdda2089e1d950.png"??
"URL=http://act.cmcmcdn.com/upload/201507/8afc2fe48db9060fe1bdda2089e1d950.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t18.inf"??
LAST);
web_url("3b491068507d8f85ea7b35d756da7215.png"??
"URL=http://act.cmcmcdn.com/upload/201507/3b491068507d8f85ea7b35d756da7215.png"??
"Resource=1"??
"RecContentType=image/png"??
"Referer=http://127.0.0.1:1080/WebTours/"??
"Snapshot=t19.inf"??
LAST);
web_concurrent_end(NULL);
lr_start_transaction("???");
lr_think_time(15);
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=t20.inf"??
"Mode=HTTP"??
ITEMDATA??
//??BL???????泣??????value????????????
//??????????session???????????????????????????????replace with a parameter??????????????????
"Name=userSession"?? "Value={BL}"?? ENDITEM??
"Name=username"?? "Value=test1"?? ENDITEM??
"Name=password"?? "Value=test1"?? ENDITEM??//password?????????????????? "PASS";??????????????"FAIL"
"Name=JSFormSubmit"?? "Value=off"?? ENDITEM??
"Name=login.x"?? "Value=48"?? ENDITEM??
"Name=login.y"?? "Value=13"?? ENDITEM??
LAST);
web_concurrent_start(NULL);
web_url("nav.pl_2"??
"URL=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Resource=0"??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/login.pl"??
"Snapshot=t21.inf"??
"Mode=HTTP"??
LAST);
//????????2???????
web_reg_find("Text=test1"??
"SaveCount=num"??//?????num??????????test1
"Search=Body"??
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=t22.inf"??
"Mode=HTTP"??
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("flights.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/flights.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t23.inf"??
LAST);
web_url("itinerary.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/itinerary.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t24.inf"??
LAST);
web_url("signoff.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/signoff.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t25.inf"??
LAST);
web_url("in_home.gif"??
"URL=http://127.0.0.1:1080/WebTours/images/in_home.gif"??
"Resource=1"??
"RecContentType=image/gif"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"??
"Snapshot=t26.inf"??
LAST);
web_concurrent_end(NULL);
//?ж??????????
if(atoi(lr_eval_string("{num}"))>=1){//?ж????Num????????????????????????????1
lr_end_transaction("???"?? LR_PASS);//??????????LR_PASS
}
else{
lr_end_transaction("???"?? LR_FAIL);//????????LR_FAIL
}
return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11