测试邮件服务器性能的一个问题
邮件服务器为james,客户端为outlook express,收取邮件的协议为imap.用LR8.1录制了某用户查询收件箱的操作, 但回放脚本总是出错.出错的脚本为imap_fetch_ex(&imap2, "FetchMessages",
"Mode=UID",
"Fetch=1:22 (UID FLAGS)",ENDITEM,
LAST);
错误信息为:00000004 UID FETCH 1:22 (UID FLAGS)
Action.c(24): 28-byte response body for IMAP Fetch
* 1 FETCH (FLAGS () UID 1)
Message #1 FETCH (FLAGS () UID 1)
Action.c(24): 58-byte response body for IMAP Fetch
* 2 FETCH (FLAGS () UID 2)
00000004 OK FETCH completed.
Action.c(24): Error -87219:Response timed out (connection terminated).
Abort was called from an action.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
哪位兄弟以前用LR测试过IMAP协议,帮忙解答一下啊. 我怀疑是LR的imap_fetch_ex函数有问题,明明fetch的邮件信息都以正确返回,为什么会返回服务器响应超时的错误. 我录制回放正常
lr9.1
回复 2# 的帖子
你好,帮忙把你的脚本发一下看看啊! 帮你顶了一个SMTP协议的例子
SMTP ppsmtp;smtp_logon_ex(&ppsmtp, "Logon", "URL=smtp://<user>@<smtpURL>",
"CommonName=LoadRunner SMTP TestScript", NULL);
smtp_send_mail_ex(&ppsmtp,"SendMail",
"To=<user>@c2l2.com",
"Subject=SMTP Test for <user>@<smtpURL>",
"MAILOPTIONS",
"X-Priority: 3",
"X-MSMail-Priority: Medium",
"X-Mailer: Microsoft Outlook Express 5.50",
"X-MimeOLE: By Microsoft MimeOLE V5.50",
"MAILDATA",
"MessageText="
"Content-Type: text/plain;\r\n"
"\tcharset=\"iso-8859-1\"\r\n"
"Content-Transfer-Encoding: quoted-printable\r\n"
"\r\n"
"Test,\r\n"
"<HTML><BODY>"
"<H1><CENTER> TEST LOADRUNNER </CENTER></H1>"
"</BODY></HTML>\r\n",
"MessageBlob=512000",
NULL);
smtp_logout_ex(&ppsmtp); 本帖最后由 lwm63122658 于 2011-4-27 17:28 编辑
楼上,人家要imap,你发smtp的干啥 也碰到楼主的问题,有知道解决方法的么? 今天也遇到相同问题,不过fetch UID的时候正常,fetch BODY的时候报和楼主相同的错误:dizzy: 原本我只是想调试读取收件箱中的邮件体,所以使用先读取固定一封邮件的方式来试,开始脚本如下:
........
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=2 UID", ENDITEM,
LAST);
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=2 BODY[]", ENDITEM,
LAST);
imap_logout_ex(&imap1);
imap_free_ex(&imap1);
.......
固定读取一封邮件,然后就logout时会存在楼主说的问题,也是我前面遇到的问题,后面通过以下方式可以达到我预想的效果:
方式一:
........
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=2 UID", ENDITEM,
LAST);
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=2 BODY[]", ENDITEM,
LAST);
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=1 UID", ENDITEM,
LAST);
imap_logout_ex(&imap1);
imap_free_ex(&imap1);
.......
即在读取UID为2的邮件体后面,再加一个读取UID为1的动作,这样读取该邮件夹中UID为2的邮件体,编译正常通过
方式二:
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=2 UID", ENDITEM,
LAST);
imap_fetch_ex(&imap1, "FetchMessages",
"Mode=",
"Fetch=2:* BODY[]", ENDITEM,
LAST);
imap_logout_ex(&imap1);
imap_free_ex(&imap1);
即"Fetch=2 BODY[]"用"Fetch=2:* BODY[]"代替,这样读取该邮件夹中所有的邮件体,编译通过 楼主后面怎么解决?
页:
[1]