琢磨了好久就是不明白,麻烦各位看一下
本帖最后由 music51555 于 2015-4-26 11:59 编辑web_reg_find("text=welcome",
LAST);
1. 该函数放在web_submit_form前就可以查找到“welcome”
日志为:
web_submit_form("login.pl") was successful
2. 但是放在web_submit_data前就无法查找到
日志为:
Action.c(22): Error -26366: "Text=welcome" not found for web_reg_find
Action.c(22): web_submit_data("login.pl") highest severity level was "ERROR", 795 body bytes, 225 header bytes
录制的脚本为:
web_submit_form:
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);
web_reg_find("text=welcome",
LAST);
web_submit_form("login.pl",
"Snapshot=t4.inf",
ITEMDATA,
"Name=username", "Value=alex", ENDITEM,
"Name=password", "Value=30761234", ENDITEM,
"Name=login.x", "Value=53", ENDITEM,
"Name=login.y", "Value=6", ENDITEM,
LAST);
web_submit_data:
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);
web_reg_find("text=welcome",
LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=115832.473309032fQfiVDcpitfiDDDDDfHtipHQHAHf", ENDITEM,
"Name=username", "Value=alex", ENDITEM,
"Name=password", "Value=30761234", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=54", ENDITEM,
"Name=login.y", "Value=14", ENDITEM,
LAST);
Thanks for All of you!:handshake
因为web_submit_data("login.pl") 出错了啊,出错了就找不到了。
Action.c(22): web_submit_data("login.pl") highest severity level was "ERROR", 795 body bytes, 225 header bytes
这个日志信息就是说 web_submit_data("login.pl")这个页面 error了。 saharaqs 发表于 2015-4-25 22:40
因为web_submit_data("login.pl") 出错了啊,出错了就找不到了。
Action.c(22): web_submit_data("login.p ...
但是去掉web_reg_find函数就是成功的。。
web_submit_data("login.pl") was successful, 795 body bytes, 225 header bytes
麻烦看看,谢谢 我自己已经解决了,谢谢楼上给的提示
在web_submit_data函数中,需要为usersession添加关联(但是我没有在web tours管理页面中开启"Set LOGIN form's action tag to an error page"选项。。)
在添加手动关联后使用“web_reg_find”函数后就成功找到了“welcome”文本
附上代码如下:
Action()
{
web_reg_save_param("usersession",
"LB/IC=name=userSession value=",
"RB/IC=>",
"ORD=1",
LAST);
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);
web_reg_find("text=welcome",
LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={usersession}", ENDITEM,
"Name=username", "Value=alex", ENDITEM,
"Name=password", "Value=30761234", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=54", ENDITEM,
"Name=login.y", "Value=14", ENDITEM,
LAST);
return 0;
}
终觉了却了这个问题,谢谢大家!:victory:
但是却不明白,为什么使用web_reg_find函数,且未开启“Set LOGIN form's action tag to an error page”选项,却出现了分配随机会话ID的问题,还需要手动创建关联,这个问题麻烦大家帮忙看下,谢谢:hug: 手动关联跟检查点没有关系,是两码事。web_reg_find()是注册型函数,需要写在前面。
页:
[1]