????Vuser ????????Visual User Generator??VuGen??????????????????????????????HTTP????????Щ?????????????????????????HTTP??????η?????????????????????
?????????????????????????????????????????????
??????????
??????????HP?????????????????????????δ??????|???г???|HP Loadrunner|Samples|web|HP Tours Web Application???????????????????????μ?Web Server ????????????????
?????????????????????????к??????????
????????????VuGen???????δ??????|???г???|HP Loadrunner|Applications|Visual User Generator?????1???????



?1??????????ù??????????????????????????‘?????????????’??

????????????е?New Script?????????????????????????????????2??????????????loadrunner??3?????Э?????????Э????????Э?????????ù???Э?顣


????
?2

????????????????У??漰?????????????????Э?飬????Э?齫????????????????????????????????????????????????Э????????÷????м????
????1???????????????????????????Э?飻
????2?????????????????????????????Э?飻
????3?????Э????????????????????????????з??????????????????Э?飬????????Э?????????
????4????????????????????ж??????????????Э?飬???????????????????
?????????????????????Э????????????ο??????3???????


??
???3

??????????????????Web(HTTP/HTML)Э?????????????
????VuGen ??????????????????????????????????VuGen ?????????????????????????????????????????????????????????????????????????IE?????????????????????????????HTTP???????????????????????IE???????????????
???????????????????????????4?????????????????£?


????
?4

????1??application type:????????????BS??CS????
????2??program to record?????????????????????????????????????????????????IE????
????3??URL???????????????
????4??working directory:???·????
????5??record into action???????????????????????????????loadrunner????????????????????vuser_int??aciton??vuser_end?????????????????????????action????????vuser_int??vuser_end??????????????????Σ???????????????????????????????????????Σ?????????κ????????У????????HTTP??????????????????????????????
????6??Record the application startup???????ó????????????????????????????????ó????????VuGen?????????????????????????????????????????ó???????????????????record?????????????
??????????????????????????????5????????????????δ?????????????????????????action??????????????????л?????????????????????????????????ü????????????


????
?5

??????????????'?????'??????????????VuGen????????????????????????LR?????????????????????????6???????


????
?6

????recording options ????
???????????????????????????Щ?Щ???????????????н???Щ???????ú???????????????????????
??????????recording options????????7??????????????????????recording?????advanced?????correlation?????


????
?7

????1??recording???
????recording level???????????????HTML-based script??URL-based script???????8?????


????
?8

????????HTML-based script???????????????
????1??????????????????GUI????????????????????????????????????????????????????????Щ?????????????????????URL??web_url????link??web_link????image??web_image???????????web_submit_form???????????£?
????????????????????????????????????????????????????????????????????????????????????????????????????????web_submit_form()???ú??????????????????????????????????????
?????????2???£????????????????????????????web_submit_form()????????????????????????????飬??????????????web_submit_data()?????????????????δ???????????????鱾???????????????μ??????
web_url("WebTours"??
"URL=http://127.0.0.1:1080/WebTours/"??
"Resource=0"??
"RecContentType=text/html"??
"Referer="??
"Snapshot=t1.inf"??
"Mode=HTML"??
LAST);
web_submit_form("login.pl"?? "Snapshot=t5.inf"??
ITEMDATA?? "Name=username"?? "Value=test1"?? ENDITEM??
"Name=password"?? "Value=test1"?? ENDITEM?? "Name=login.x"?? "Value=0"?? ENDITEM??
"Name=login.y"?? "Value=0"?? ENDITEM??
LAST);
return 0;
????2?????????links??images??URL??????????web_link??web_image?????????web_submit_form?????????????????????????????′???
?????????????????????????????web_submit_data()???ú??????????????????????????????
web_url("WebTours"??
"URL=http://127.0.0.1:1080/WebTours/"??
"TargetFrame="??
"Resource=0"??
"RecContentType=text/html"??
"Referer="??
"Snapshot=t1.inf"??
"Mode=HTML"??
LAST);
lr_think_time(10);
web_submit_data("login.pl"??
"Action=http://127.0.0.1:1080/WebTours/login.pl"??
"Method=POST"??
"TargetFrame="??
"RecContentType=text/html"??
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home"??
"Snapshot=t5.inf"??
"Mode=HTML"??
ITEMDATA??
"Name=userSession"?? "Value=120572.007128392zcAVQccpzVzzzzzHDHcVVpfDfH"?? ENDITEM??
"Name=username"?? "Value=test1"?? ENDITEM??
"Name=password"?? "Value=test1"?? ENDITEM??
"Name=JSFormSubmit"?? "Value=off"?? ENDITEM??
"Name=login.x"?? "Value=0"?? ENDITEM??
"Name=login.y"?? "Value=0"?? ENDITEM??
LAST);
return 0;