LoadRunner设置登陆检查点 login() { lr_think_time(1); web_url("passport2", "URL=http://test232.pclady.com.cn:7003/passport2/", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t1.inf", "Mode=HTTP", LAST); web_submit_data("login.jsp", "Action=http://test232.pclady.com.cn:7003/passport2/passport/login.jsp", "Method=POST", "RecContentType=text/html", "Referer=http://test232.pclady.com.cn:7003/passport2/", "Snapshot=t2.inf", "Mode=HTTP", ITEMDATA, "Name=username", "Value={username}", ENDITEM, "Name=password", "Value=123456", ENDITEM, "Name=return", "Value=http://test232.pclady.com.cn:7003/passport2/ok.jsp", ENDITEM, "Name=track", "Value=http://test232.pclady.com.cn:7003/passport2/v.jsp", ENDITEM, "Name=loginUri", "Value=http://test232.pclady.com.cn:7003/passport2/v.jsp?a=b&c=d", ENDITEM, LAST); web_reg_find("Text={username}", "SaveCount=count", LAST); //注明:内容都在ok.jsp页面上,所以在此请求上添加检查点函数 web_url("passport2", "URL=http://test232.pclady.com.cn:7003/passport2/ok.jsp", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t1.inf", "Mode=HTTP", LAST); lr_output_message(lr_eval_string("{count}")); if (atoi(lr_eval_string("{count}")) > 0){ lr_output_message("Log on successful."); } else{ lr_error_message("Log on failed"); lr_start_transaction("login"); login(); lr_end_transaction("login",LR_PASS); return(0); } return 0; }