许愿--性能测试脚本

vuser_init()
{
	lr_load_dll("AutoLogin_ConstructUrl.dll");

	return 0;
}


char url[1024];
char *to_url;
long i=8001016;
char id[20];
Action()
{
   to_url="http://www2.im.alisoft.com/webim/other/trasfer.htm?needsignin=2&signmode=im&redirect_url=http://wangwang.im.alisoft.com:18080/";

   GenerateTokenUrlEx(lr_eval_string("{cnalichn}"),"1111112",to_url,url,1024);
//GenerateTokenUrlEx方法的to_url参数一定要为char[],而不是bstr,Loadrunner对bstr的支持不够。
   lr_message("%s",url);

   lr_save_string(url,"autoUrl");

	lr_start_transaction("AutoLogin");

	web_reg_find("Text=许愿",LAST);

	web_url("AutoLogin",
			"Url={autoUrl}",
			LAST);

	lr_end_transaction("AutoLogin", LR_AUTO);

	lr_start_transaction("Wish");

	web_url("Wish",
			"URL=http://wangwang.im.alisoft.com:18080/mkt/user/wish!displayWish.jspa",
			LAST);

	web_reg_find("Text=perFmoramnce",LAST);

	web_url("PostWish",
			"URL=http://wangwang.im.alisoft.com:18080/mkt/user/userWish!doMakeWish.jspa?inviteId=&model.wishDesc=perFmoramnce+heiheihaha............&model.wishCost=2",
			LAST);

	lr_end_transaction("Wish", LR_AUTO);

	return 0;
}




vuser_end()
{
	return 0;
}

你可能感兴趣的:(C++,c,Web,脚本,loadrunner)