|
本帖最后由 lilila1989 于 2013-1-22 10:46 编辑
使用loadrunner11或者mercury在线版,在xp上录制http单协议或http smtp双协议效果一样。
邮件登陆openwebmail发送脚本,脚本如下,仅录制action,录制程序Ie,录制回放成功,回放自动关联,使用Ip wizard,5个新增Ip,场景并发2vuser,但是实现不了自动发邮件,也就是说场景运行时,邮箱收不到新邮件。
曾经用foxmail和http,smtp双协议,实现过场景运行时loadrunner给服务器发邮件,但是这一操作无法记录web登陆信息。
目前实现对qq的邮箱录制发送邮件实现了场景并发收到信的邮件,但就是openwebmail服务器收不到,不清楚问题出在哪个环节。
即便对登陆名、密码做了参数化还是一样收不到邮件。
不知道是openwebmail本身Perl源程序有关,还是我操作有关,同样操作qq可以接收loadrunner场景并发邮件,但openwebmail收不到。怎样才能录制登录信息以及网页上的发送邮件脚本,并实现邮件场景并发自动发送。
===================以下是录制时自动关联脚本=======================================
Action()
{
web_set_max_html_param_len("1024");
web_url("openwebmail", //载入邮件服务网址
"URL=http://172.16.0.86/openwebmail",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time(9);
web_submit_form("openwebmail.pl", //登陆
"Snapshot=t2.inf",
ITEMDATA,
"Name=loginname", "Value=openwebmail", ENDITEM,
"Name=password", "Value=123", ENDITEM,
"Name=httpcompress", "Value=1", ENDITEM,
"Name=autologin", "Value=<OFF>", ENDITEM,
"Name=loginbutton", "Value=登录", ENDITEM,
LAST);
web_link("\xA0 载入中,请稍等 ...",
"Text=\xA0 载入中,请稍等 ...",
"Snapshot=t3.inf",
LAST);
web_image("写新邮件", //写新邮件
"Alt=写新邮件",
"Snapshot=t4.inf",
LAST);
/* Registering parameter(s) from source task id 113
// {PeopleSoftsessionID2} = "openwebmail*172.16.0.86-session-0.285071895548271&folder=INBOX&page=1&longpage=0&sort=date_rev&msgdatetype=sentdate&&action=logout"
// */
web_reg_save_param("eopleSoftsessionID2",
"LB/IC=sessionid=",
"RB/IC=t",
"Ord=1",
"Search=body",
"RelFrameId=1",
LAST);
web_submit_form("openwebmail-send.pl", //写邮件内容
"Snapshot=t5.inf",
ITEMDATA,
"Name=convto", "Value=utf-8 *", ENDITEM,
"Name=from", "Value=\"openwebmail_server\" <[url=mailtopenwebmail@openwebmailserver.com]openwebmail@openwebmailserver.com[/url]>", ENDITEM,
"Name=priority", "Value=普通", ENDITEM,
"Name=to", "Value=openwebmail@openwebmailserver.com", ENDITEM,
"Name=cc", "Value=", ENDITEM,
"Name=bcc", "Value=", ENDITEM,
"Name=replyto", "Value=", ENDITEM,
"Name=confirmreading", "Value=<OFF>", ENDITEM,
"Name=attachment", "Value=", "File=Yes", ENDITEM,
"Name=subject", "Value=test0020106", ENDITEM,
"Name=backupsentmsg", "Value=1", ENDITEM,
"Name=dictionary2", "Value=english", ENDITEM,
"Name=newmsgformat", "Value=纯文本", ENDITEM,
"Name=body", "Value=\r\n\r\ntest\r\n--\r\nOpen WebMail Project (http://openwebmail.org)\r\n", ENDITEM,
"Name=sendbutton", "Value=发送", ENDITEM,
LAST);
web_custom_request("YouGotMail.English.wav", //返回收件箱
"URL=http://172.16.0.86/data/openwebmail/sounds/YouGotMail.English.wav",
"Method=HEAD",
"Resource=0",
"RecContentType=audio/x-wav",
"Referer=",
"Mode=HTML",
LAST);
lr_think_time(8);
web_url("openwebmail-main.pl", //退出
"URL=http://172.16.0.86/cgi-bin/openwebmail/openwebmail-main.pl?sessionid={PeopleSoftsessionID2}",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.16.0.86/cgi-bin/openwebmail/openwebmail-main.pl?action=listmessages&sessionid=openwebmail*172.16.0.86-session-0.285071895548271&sort=date_rev&msgdatetype=sentdate&folder=INBOX&page=1&sentsubject=test0020106",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
return 0;
}
===================以下是foxmail的脚本,录制的用户不一样,不影响======================
Action()
{
web_custom_request("UploadFoxStatData",
"URL=http://datacollect.foxmail.com.cn/cgi-bin/UploadFoxStatData",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
"EncType=",
"Body=FUpdateData= [STAT_0]\r\nS_1=1094469925\r\nS_2=Foxmail\r\nS_3=7.0.1.92\r\nI_1=1154\r\nI_10=2\r\nI_11=0\r\nI_12=0\r\nI_50=2\r\n",
LAST);
lr_think_time(9);
smtp1 = 0;
smtp_logon_ex(&smtp1, "SmtpLogon",
"URL=smtp://tester001@openwebmailserver2.com",
"[url=mailtoogonUser=tester001@openwebmailserver2.com]LogonUser=tester001@openwebmailserver2.com[/url]",
"LogonPass=123",
"CommonName=LoadRunner User",
LAST);
smtp_send_mail_ex(&smtp1, "SendMail",
"To=tester001@openwebmailserver2.com",
"From=<tester001@openwebmailserver2.com> SIZE=1609",
"Subject=111111111",
"ContentType=multipart/alternative;",
MAILOPTIONS,
"From: tester001 <tester001@openwebmailserver2.com>",
"To: tester001 <tester001@openwebmailserver2.com>",
"Reply-To: tester001 <tester001@openwebmailserver2.com>",
"X-Priority: 3",
"X-Has-Attach: no",
"X-Mailer: Foxmail 7.0.1.92[cn]",
MAILDATA,
"AttachRawFile=mailnote1_01.dat",
"AttachRawFile=mailnote1_02.dat",
LAST);
smtp_logout_ex(&smtp1);
smtp_free_ex(&smtp1);
return 0;
} |
|