欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Loadrunner12设置检查点

程序员文章站 2022-04-11 13:13:33
...

Loadrunner12设置检查点

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

目录

简介:

webtours登录脚本设置检查点

步骤:

【1】准备好webtours登录脚本

Loadrunner12设置检查点
【2】加入检查点
Loadrunner12设置检查点
【3】最后run

Loadrunner12设置检查点

脚本:

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<table border",
		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, <b>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