Loadrunner12设置检查点

Loadrunner12设置检查点

ps:如果你觉得对你有帮助的话,麻烦点个赞加个关注

目录

  • 简介:
  • 步骤:
  • 脚本:

简介:

webtours登录脚本设置检查点

步骤:

【1】准备好webtours登录脚本

Loadrunner12设置检查点_第1张图片
【2】加入检查点
Loadrunner12设置检查点_第2张图片
【3】最后run

Loadrunner12设置检查点_第3张图片

脚本:

Action()
{
     

/*Correlation comment - Do not change!  Original value='128549.640421223zzVccHcpVcQVzzzHDQzHDpzDcHHf' Name ='CorrelationParameter' Type ='ResponseBased'*/
	web_reg_save_param_ex(
		"ParamName=CorrelationParameter",
		"LB=name=\"userSession\" value=\"",
		"RB=\"/>\n,
		SEARCH_FILTERS,"Scope=Body","IgnoreRedirections=No","RequestUrl=*/nav.pl*",
		LAST);web_url("WebTours","URL=http://127.0.0.1:1080/WebTours/","Resource=0","RecContentType=text/html","Referer=","Snapshot=t55.inf","Mode=HTML", 
		LAST);lr_think_time(4);web_reg_find("Text=Welcome, jojo","SaveCount=paramCount",LAST);

	web_submit_data("login.pl",
		"Action=http://127.0.0.1:1080/cgi-bin/login.pl",
		"Method=POST",
		"RecContentType=text/html",
		"Referer=http://127.0.0.1:1080/cgi-bin/nav.pl?in=home",
		"Snapshot=t68.inf",
		"Mode=HTML",
		ITEMDATA,
		"Name=userSession", "Value={CorrelationParameter}", ENDITEM,
		"Name=username", "Value=jojo", ENDITEM,
		"Name=password", "Value=bean", ENDITEM,
		"Name=JSFormSubmit", "Value=off", ENDITEM,
		"Name=login.x", "Value=62", ENDITEM,
		"Name=login.y", "Value=10", ENDITEM,
		LAST);
	
	lr_think_time(4);
	
	if(atoi(lr_eval_string("{paramCount}"))>0){
     
		lr_log_message("sucessful!!!");
	}
	else{
     
		lr_log_message("Fail!!!");
	}

	return 0;
}
 
  

                            
                        
                    
                    
                    

你可能感兴趣的:(Loadrunner,loadrunner)