??????????????????????????????????????????????loadrunner?б?д?????????X ?????????????????δ???????????????????????????????????????????з???????????????????????????????????????η??
????????????loadrunner????C?????????????????????????????loadrunner????????C????????????????????????????????磺Java User??VB User??VB script User ??Javascript User??Mmicrosoft .NET??????????????????????C??????????ɡ?
?????????дloadrunner????????
????????????????г???????????????????????????????????·????????????С?????????·??2С??????????????????????????????????????????????????????????г??????????磬???????????????г????????????????·?????????
?????????????loadrunner?????????????????????????????д????????????????д?????
???????loadrunner?????????????????????????????????????????????????????????
????Loadrunner????????С????????

????????????? Start Web server ???????????????????????????????????X ???????????????
????http://127.0.0.1:1080/WebTours/??????????????loadrunner??????????????
????Action()
????{
????web_url("WebTours"??
????"URL=http://127.0.0.1:1080/WebTours/"??
????"Resource=0"??
????"RecContentType=text/html"??
????"Referer="??
????"Snapshot=t1.inf"??
????"Mode=HTML"??
????LAST);
????lr_rendezvous("?????");
????lr_start_transaction("??????");
????web_submit_form("login.pl"??
????"Snapshot=t2.inf"??
????ITEMDATA??
????"Name=username"?? "Value=test1"?? ENDITEM??
????"Name=password"?? "Value=123456"?? ENDITEM??
????"Name=login.x"?? "Value=59"?? ENDITEM??
????"Name=login.y"?? "Value=5"?? ENDITEM??
????LAST);
????lr_end_sub_transaction("??????"??LR_ABORT);
????return 0;
????}????
???????????????д?????“????”?????????“ return ”????????б???????????????????????????????????????????????????????????????????綨?峣???????????????if....else if....??????????for...??
???????????????д??С????????????????????????????
????#define COUNT 100
????#define SALARY 4000
????Action()
????{
????int total;
????total = COUNT * SALARY;
????lr_output_message("100????н??????:%d"??total);
????return 0 ;
????}
????#define COUNT 100
????#define SALARY 4000     ???????????????
????lr_output_message    ????????????????????C ????????????C?????????println ??????????
???????н????
????..........
????Starting iteration 1.
????Starting action Action.
????Action.c(9): 100????н??????:400000    ----???????н????????
????Ending action Action.
????Ending iteration 1.
????..........
??????????????С????                                                              
???????????????????????????????????loadrunner ??????????????????????Щ?????С???????????????????
???????濴????????????С????????漴??????????????switch?????
????Action()
????{
????int randomnumber;  
????randomnumber = rand() % 3+1;
????switch (randomnumber) {
????case 1:
????{
????lr_rendezvous("??????????");
????web_url("www.baidu.com"??
????"URL=http://www.baidu.com/"??
????"Resource=0"??
????"RecContentType=text/html"??
????"Referer="??
????"Snapshot=t12.inf"??
????"Mode=HTML"??
????EXTRARES??
????"Url=http://s1.bdstatic.com/r/www/img/i-1.0.0.png"?? ENDITEM??
????"Url=/favicon.ico"?? "Referer="?? ENDITEM??
????"Url=http://s1.bdstatic.com/r/www/img/bg-1.0.0.gif"?? ENDITEM??
????LAST);
????return 0;
????}
????case 2:
????{
????lr_rendezvous("?????輯???");
????web_url("www.google.com.hk"??
????"URL=http://www.google.com.hk/"??
????"Resource=0"??
????"RecContentType=text/html"??
????"Referer="??
????"Snapshot=t10.inf"??
????"Mode=HTML"??
????EXTRARES??
????"Url=http://ssl.gstatic.com/gb/images/b_8d5afc09.png"?? ENDITEM??
????"Url=/images/srpr/logo3w.png"?? ENDITEM??
????"Url=/extern_chrome/749e1ce3c3e5f171.js"?? ENDITEM??
????"Url=/images/swxa.gif"?? ENDITEM??
????"Url=/favicon.ico"?? "Referer="?? ENDITEM??
????"Url=http://ssl.gstatic.com/gb/js/sem_0e1289051da7e9e3697c2025d9490acd.js"?? ENDITEM??
????"Url=http://www.google.com/textinputassistant/tia.png"?? ENDITEM??
????LAST);
????return 0;
????}
????case 3:
????{
????lr_rendezvous("?????е??????");
????web_url("www.youdao.com"??
????"URL=http://www.youdao.com/"??
????"Resource=0"??
????"RecContentType=text/html"??
????"Referer="??
????"Snapshot=t7.inf"??
????"Mode=HTML"??
????EXTRARES??
????"Url=http://shared.ydstatic.com/oxo/p/pic.gif"?? ENDITEM??
????"Url=http://shared.ydstatic.com/oxo/p/logo.png?1"?? ENDITEM??
????"Url=http://shared.ydstatic.com/oxo/p/nv_line.gif"?? ENDITEM??
????"Url=http://shared.ydstatic.com/r/2.0/p/pic.gif"?? ENDITEM??
????LAST);
????return 0;
????}
????}
????}