The 1.Java vuser template script is as follows:
/* * LoadRunner Java script. (Build: _build_number_) * * Script Description: * */import java.util.hashmap;import com. Interface.filmnews;import com. Interface.plans;import com.vug.vug;import Lrapi.web;import lrapi.lr;public class Actions{public static String uid = "Ko" ;p ublic static string md5key = "JJ";p ublic static string filmhost = "Http://115.28.1/cias_web/server";p ublic static string Planhost = "Http://115.28.1/order/server"; Hashmap<string, string> params; Vug Vug; Build Build urlfilmnews fn; Video interface Plans PN; Order Interface public int init () throws Throwable {vug = new Vug (uid, md5key); params = new hashmap<string, string> (); fn = new Filmnews (UID);//pn = new plans (UID); return 0;} End of Initpublic int action () throws Throwable {params = Fn.cinemas ();//interface to be tested string url = Vug.geturl (Filmhost, p Arams); Lr.start_transaction ("test"); Lr.think_time (1); Web.reg_find ("text=errcode\": 0 ", New string[]{" Savecount=errcode ", web. Last}); Web.rEg_save_param ("All", new String []{"lb={\" cinemaid\ ":", "rb=,", "Search=body", "Ord=all", "Last"}) ; Web.url ("Test", "url=" + url,new string[] {"Targetframe=", "resource=0", "reccontenttype=text/html", "mode=htm L "," Last "});/*params = Pn.orderadd (" <test> "," <test1> "," <test2> "); URL = vug.geturl (host, params); w Eb.url ("Test", "url=" + url,new string[] {"Targetframe=", "resource=0", "reccontenttype=text/html", "mode=html "Last"}); */if (Lr.eval_int ("<errCode>") = = 1) {lr.end_transaction ("test"), LR. PASS);} else {lr.error_message (lr.eval_string ("<all_1>")); Lr.end_transaction ("Test", LR. FAIL);} return 0;} End of Actionpublic int end () throws Throwable {return 0;} End of End}
2. The above script is tested in the controller, and the other LR11 supports up to 1000java vuser virtual users, license as follows:
Golba-100:aeamauik-yafekekjjkeea-bcjgi
Golba-1000:aeacfsji-yasekjjkeahjd-bclbr
Web-10000:aeabexfr-ytiekekjjmfkekekwbraunqju-kbygb
LoadRunner + Java Script Chapter III