Action()
{
int a=1;
web_set_max_html_param_len("10000000");
//获取portal地址
web_reg_save_param("server_url",
"LB=ServerUrl\":\"",
"RB=\",\"LoginName",
LAST);
//获取uniqueid
web_reg_save_param("unique_id",
"LB=UserToken\":\"",
"RB=\",\"ExpireSeconds",
LAST);
//认证接口测试
web_reg_find("Text=\"RetCode\":200",
LAST);
srand(time(0));
a=rand()%5;
lr_log_message("a====%d",a);
lr_rendezvous("auth");
lr_start_transaction("auth");
web_url("authTerminal",
"URL=http://www.sitvs.com/auth/terauth/authTerminal?sn=11111&terminalType=stb&mac=2323",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_end_transaction("auth", LR_AUTO);
lr_think_time(5);
/*
lr_log_message("unique_id=%s",lr_eval_string("{unique_id}"));
lr_log_message("server_url=%s",lr_eval_string("{server_url}"));
//获取contentId
web_reg_save_param("contentId",
"LB=contentId",
"RB=\",",
"ORD=1",
"SaveOffset=4",
LAST);
//推荐接口测试
web_reg_find("Text=status\": \"200",
LAST);
lr_start_transaction("BoxHome");
web_url("authTerminal",
"URL={server_url}/apiBoxHome/boxHome?uniqueId={unique_id}",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_end_transaction("BoxHome", LR_AUTO);
lr_log_message("contentId=%s",lr_eval_string("{contentId}"));
//详情接口测试
web_reg_find("Text=status\": \"200",
LAST);
lr_start_transaction("MovieInfo");
web_url("authTerminal",
"URL={server_url}/apiMovies/getMovies?uniqueId={unique_id}&moviesId={contentId}",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_end_transaction("MovieInfo", LR_AUTO);
*/
return 0;
}