LoadRunner关联介绍自动关联自动关联比较简单,只要在Tools->RecordingOptions->Correlation设置可用就可以了。自动关联可能会出错,所以不建议使用自动关联。手动关联录制登录脚本(青铜器网站为例)以下为关联后的代码。Action(){//Correlationcomment-Donotchange!Originalvalue='E282B0271708B45C31B1AA21498DFE5A'Name='CorrelationParameter_1'web_reg_save_param_ex("ParamName=CorrelationParameter_1","LB=Set-Cookie:JSESSIONID=","RB=;Path",SEARCH_FILTERS,"Scope=All","IgnoreRedirections=Yes","RequestUrl=*/index.jsp*",LAST);web_url("index.jsp","URL=http://192.168.0.123:3000/index.jsp","Resource=0","RecContentType=text/html","Referer=","Snapshot=t18.inf","Mode=HTML",LAST);web_custom_request("jSystemFilterBean.IsShowValidateCode.dwr","URL=http://192.168.0.123:3000/dwr/call/plaincall/jSystemFilterBean.IsShowValidateCode.dwr","Method=POST","Resource=0","RecContentType=text/javascript","Referer=http://192.168.0.123:3000/index.jsp","Snapshot=t19.inf","Mode=HTML","EncType=text/plain","Body=callCount=1\n""page=/index.jsp\n""httpSessionId={CorrelationParameter_1}\n""scriptSessionId=750F49C3DA1731E1EF25170F88D6526D843\n""c0-scriptName=jSystemFilterBean\n""c0-methodName=IsShowValidateCode\n""c0-id=0\n""c0-param0=string:10.36.0.133\n""batchId=0\n",LAST);web_add_cookie("username=c929;DOMAIN=192.168.0.123");web_add_cookie("userpassword=;DOMAIN=192.168.0.123");web_submit_data("j_security_check;jsessionid=E282B0271708B45C31B1AA21498DFE5A","Action=http://192.168.0.123:3000/j_security_check;jsessionid={CorrelationParameter_1}","Method=POST","RecContentType=text/html","Referer=http://192.168.0.123:3000/index.jsp","Snapshot=t20.inf","Mode=HTML",ITEMDATA,"Name=isExpires","Value=1",ENDITEM,"Name=sessionIndex","Value=",ENDITEM,"Name=j_username","Value=c929",ENDITEM,"Name=j_password","Value=MTIzNDU2",ENDITEM,"Name=j_showcode","Value=N",ENDITEM,"Name=j_validatecode","Value=",ENDITEM,"Name=BROWSER_VERSION","Value=8",ENDITEM,"Name=REMOTE_LANGUAGE","Value=zh-cn",ENDITEM,EXTRARES,"URL=/images/buttonmenu/menu_downarrow_white.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/icon158.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/buttonmenu/menu_downarrow_gray.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/imgpreview/fancy_close.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/imgpreview/blank.gif","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/imgpreview/fancy_loading.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/imgpreview/fancy_nav_left.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,"URL=/images/imgpreview/fancy_nav_right.png","Referer=http://192.168.0.123:3000/main.do",ENDITEM,LAST);web_custom_request("jSystemFilterBean.dyn_getUserConfig.dwr","URL=http://192.168.0.123:3000/dwr/call/plaincall/jSystemFilterBean.dyn_getUserConfig.dwr","Method=POST","Resource=0","RecContentType=text/javascript","Referer=http://192.168.0.123:3000/main.do","Snapshot=t21.inf","Mode=HTML","EncType=text/plain","Body=callCount=1\n""page=/main.do\n""httpSessionId={CorrelationParameter_1}\n""scriptSessionId=750F49C3DA1731E1EF25170F88D6526D698\n""c0-scriptName=jSystemFilterBean\n""c0-methodName=dyn_getUserConfig\n""c0-id=0\n""batchId=0\n",LAST);web_url("myTask.jsf","URL=http://192.168.0.123:3000/pages/task/list/myT...