loadrunner脚本001

时间:2023-03-10 07:12:26
loadrunner脚本001
 Action()
{
int result = ; lr_start_transaction("login"); web_add_cookie("JSESSIONID=061460B7DFF2F7C2C4275FE06EE08184; DOMAIN=abcd.com"); web_add_header("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"); web_set_max_html_param_len(""); web_reg_save_param_ex(
"ParamName=return_url",
"LB=Location: ",
"RB=\r\n",
SEARCH_FILTERS,
"Scope=Headers",
LAST); web_submit_data("login",
"Action=https://xxxxx.xom",
"Method=POST",
"RecContentType=text/plain",
"Referer=https://xxxx.abc",
"Mode=HTML",
ITEMDATA,
"Name=j_username", "Value=admin", ENDITEM,
"Name=j_password", "Value=123456", ENDITEM,
"Name=x", "Value=162", ENDITEM,
"Name=y", "Value=22", ENDITEM,
LAST); result = strcmp(lr_eval_string("{return_url}"), "https://alpha.jxedc.com:8383/touch.html"); //lr_output_message("login successfu! login_count is: %d", result); //lr_output_message("login successfu! cookie value is: %s", lr_eval_string("{return_url}")); if(result == )
{
lr_end_transaction("login", LR_PASS);
}
else
{
lr_end_transaction("login", LR_FAIL);
} return ;
}