检查点问题:已检查到内容了,为何savecount=0呢?(已解决)
本帖最后由 夏日摸摸茶 于 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", "7D@163.com]Value={username}@163.com", 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
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=退出"
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
Action.c(69): web_url("Discuz! Board") was successful, 19638 body bytes, 233 header bytes, 13 chunking overhead bytes
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 还是出现这种问题。 会不会与录制选择的协议有关,你选的是什么协议? 会不会与录制选择的协议有关,你选的是什么协议?
wzhg220 发表于 2011-6-25 19:20 http://bbs.51testing.com/images/common/back.gif
协议是 web(HTTP/HTML) 我的问题是单独的脚本中savecount=1,结果将脚本拷到另外一个脚本中,savecount=0,很奇怪,相同的脚本,换个地方就不一样了 gbk的貌似不用勾选utf-8吧,你把这个勾选去掉,重新录制再检查看看。 简单来说就是编码不同导致的问题。。 简单来说就是编码不同导致的问题。。
云层 发表于 2012-9-19 17:59 http://bbs.51testing.com/images/common/back.gif
版主,能不能详细说明下呢 我现在也是遇到这个问题,迟迟不能解决,编码问题我也试过改成英文了,就连参数化我都用一个固定用户和密码登录,还是返回0,。。。
页:
[1]