|
本帖最后由 夏日摸摸茶 于 2011-6-25 16:09 编辑
录制一个注册的脚步,检测注册用户是否成功,注册成功后,界面会自动跳转到首页
主要脚步如下:
Action()
{
web_url("register.php",
"URL=http://10.50.11.47/discuz/register.php",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.50.11.47/discuz/index.php",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"URL=forumdata/cache/style_1_calendar.css", ENDITEM,
"URL=images/default/headactions_line.gif", ENDITEM,
"URL=ajax.php?inajax=1&action=checkusername&username={username}", ENDITEM,
"URL=images/default/check_right.gif", ENDITEM,
"URL=images/default/arrow_down.gif", ENDITEM,
"URL=ajax.php?inajax=1&action=checkemail&email={username}@163.com", ENDITEM,
LAST);
web_reg_find("Search=All",
"SaveCount=times",
"Text=退出",
LAST);
web_submit_data("register.php_2",
"Action=http://10.50.11.47/discuz/register.php?regsubmit=yes",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://10.50.11.47/discuz/register.php",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=formhash", "Value=2369ef5b", ENDITEM,
"Name=referer", "Value=http://10.50.11.47/discuz/index.php", ENDITEM,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value={username}", ENDITEM,
"Name=password2", "Value={username}", ENDITEM,
"Name=email", "[url=mailto:Value=%7Busername%7D@163.com]Value={username}@163.com[/url]", ENDITEM,
"Name=questionid", "Value=0", ENDITEM,
"Name=answer", "Value=", ENDITEM,
"Name=gendernew", "Value=0", ENDITEM,
"Name=bday", "Value=0000-00-00", ENDITEM,
"Name=locationnew", "Value=", ENDITEM,
"Name=site", "Value=", ENDITEM,
"Name=qq", "Value=", ENDITEM,
"Name=msn", "Value=", ENDITEM,
"Name=icq", "Value=", ENDITEM,
"Name=yahoo", "Value=", ENDITEM,
"Name=taobao", "Value=", ENDITEM,
"Name=alipay", "Value=", ENDITEM,
"Name=bio", "Value=", ENDITEM,
"Name=styleidnew", "Value=", ENDITEM,
"Name=tppnew", "Value=0", ENDITEM,
"Name=pppnew", "Value=0", ENDITEM,
"Name=timeoffsetnew", "Value=9999", ENDITEM,
"Name=timeformatnew", "Value=0", ENDITEM,
"Name=dateformatnew", "Value=0", ENDITEM,
"Name=pmsoundnew", "Value=1", ENDITEM,
"Name=showemailnew", "Value=1", ENDITEM,
"Name=newsletter", "Value=1", ENDITEM,
"Name=signature", "Value=", ENDITEM,
EXTRARES,
"URL=images/default/usericon.gif", "Referer=http://10.50.11.47/discuz/register.php?regsubmit=yes", ENDITEM,
"URL=images/default/homelink.gif", "Referer=http://10.50.11.47/discuz/register.php?regsubmit=yes", ENDITEM,
"URL=pm.php?checknewpm=0.6235715074109227&inajax=1&ajaxtarget=pmnotice", "Referer=http://10.50.11.47/discuz/register.php?regsubmit=yes", ENDITEM,
LAST);
web_url("Discuz! Board",
"URL=http://10.50.11.47/discuz/index.php",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
if(atoi(lr_eval_string ("{times}"))>0)
lr_output_message("Log on successful");
else
lr_error_message("Log on failed");
return 0;
}
参数化正确 也勾选UTF-8了 通过LR的自带浏览器中,也能看到结果页面中出现了退出的字样,但日志中,设置的savecount(times参数)输出为0,且最后输出:Log on faild 弄了老半天了 不知道为啥,网上说的也不多,请各位帮忙分析分析
主要日志:
Action.c(21): Registering web_reg_find was successful [MsgId: MMSG-26390]
Action.c(25): Notify: Parameter Substitution: parameter "username" = "test0006"
Action.c(25): Notify: Parameter Substitution: parameter "username" = "test0006"
Action.c(25): Notify: Parameter Substitution: parameter "username" = "test0006"
Action.c(25): Notify: Parameter Substitution: parameter "username" = "test0006"
Action.c(25): Registered web_reg_find successful for "Text=退出" [MsgId: MMSG-26362]
Action.c(25): Notify: Saving Parameter "times = 0"
Action.c(25): web_submit_data("register.php_2") was successful, 3799 body bytes, 1286 header bytes [MsgId: MMSG-26386]
Action.c(69): web_url("Discuz! Board") was successful, 19638 body bytes, 233 header bytes, 13 chunking overhead bytes [MsgId: MMSG-26385]
Action.c(79): Notify: Parameter Substitution: parameter "times" = "0"
Action.c(82): Error: Log on failed
Ending action Action.
Ending iteration 1.
我换了其他的检查内容,也不行 提供一个返回信息的图片界面
愁死我啦 先谢谢各位
补充:我用LR同样的操作录制了 自带的WEB订票系统,检查welcome的关键字,结果times=1,正常
然后又看了下之前的 日志 有一个错误
error was encountered while trying to use an ErrorDocument to handle the request.</p>
这句话是什么意思:?
跟群里讨论了一下 当为检查的内容中文时,web_reg_find 函数在缓存中 读取的是无法识别的内容 因此times=0是编码方式的差异引起的问题,把要检查的内容设置为英文,则可以正常输出times=1等等
我测的网站是 charset=gbk 这样的,不清楚为什么勾选了 UTF-8 还是出现这种问题。 |
|