|
本来以为解决了,后来发现还是不行。
例如最初录制时,数据库数据为100条。web_reg_find确定网页上有“100条”这几个字符。返回成功
当删除数据库数据后,变为99条,web_reg_find确定网页上有“99条”这几个字符。返回成功
当增加数据后,变为110条, web_reg_find 这个函数就如同失效一样,什么都判断不出来了,每次都返回错误,即使删除数据到100条。
错误提示
Action.c(730): Error -26366: "Text=100条" not found for web_reg_find [MsgId: MERR-26366]
Action.c(730): web_custom_request("TrustDiskAuth-viewer.jsp") highest severity level was "ERROR", 83683 body bytes, 253 header bytes, 92 chunking overhead bytes [MsgId: MMSG-26387]
大家明白吗?
录制了一段查询数据功能的网页,此网页使用的是水晶报表生成的结果。
我从中查找数据条数是否正确。例如网页上写着总共100条。
我用web_reg_find确定网页上有“100条”这几个字符。
但是当结果发生变化时,比如网页上没有100条了,查询出200条时,脚本没有改变,还是web_reg_find查找“100条”这几个字符,结果还是返回成功,能够查询到“100条”。
这是怎么回事啊?!即使清除IE临时文件也不行。
代码如下。大家帮帮忙,看哪错了
蓝色那段是查询代码。
#include "web_api.h"
Action()
{
web_cleanup_cookies();
web_cache_cleanup();
//进行关联
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 3
// {JSESSIONID2} = "B48A393AEADDB524CEF6C8F23CF65890"
// */
web_reg_save_param("JSESSIONID2",
"LB/IC=jsessionid=",
"RB/IC=\"",
"Ord=1",
"RelFrameId=1",
"Search=body",
LAST);
//登陆系统
web_url("trsmconsole",
"URL=http://192.168.16.69:8080/trsmconsole",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_output_message("jesessionid=%s", lr_eval_string("{JSESSIONID2}"));
web_submit_form("Default.do;jsessionid={JSESSIONID2}",
"Snapshot=t2.inf",
ITEMDATA,
"Name=userName", "Value=test", ENDITEM,
"Name=password", "Value=1234567a", ENDITEM,
"Name=imageField.x", "Value=80", ENDITEM,
"Name=imageField.y", "Value=45", ENDITEM,
EXTRARES,
"URL=images/p_bg.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/t_l.htm", ENDITEM,
"URL=trsm/scr192.168.16.69t/tree_dom.js", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/sxicon2.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/base.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/nolines_plus.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/sxicon4.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/empty.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/sxicon3.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
"URL=images/nolines_minus.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/NavigationAction.do", ENDITEM,
LAST);
//进入查询页面
web_url("tab.htm",
"URL=http://192.168.16.69:8080/trsmconsole/trsm/report/tab.htm?LOG_9-1-1-1",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.16.69:8080/trsmconsole/trsm/main0.jsp",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
web_url("InstantReportAction.do",
"URL=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/tab.htm?LOG_9-1-1-1",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"URL=../images/top.jpg", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/tab.htm?LOG_9-1-1-1", ENDITEM,
"URL=/trsmconsole/images/on_tabs.jpg", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/tab.htm?LOG_9-1-1-1", ENDITEM,
"URL=/trsmconsole/control/My97DatePicker/skin/WdatePicker.css", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1", ENDITEM,
"URL=../images/index_26.jpg", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1", ENDITEM,
LAST);
//输入参数
web_url("InputParameters.xml",
"URL=http://192.168.16.69:8080/trsmconsole/config/InputParameters.xml",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"URL=../control/My97DatePicker/skin/datePicker.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1", ENDITEM,
LAST);
web_url("My97DatePicker.htm",
"URL=http://192.168.16.69:8080/trsmconsole/control/My97DatePicker/My97DatePicker.htm",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1",
"Snapshot=t6.inf",
"Mode=HTML",
EXTRARES,
"URL=skin/datePicker.gif", "Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/InstantReportAction.do?RptType=LOG_9-1-1-1", ENDITEM,
"URL=lang/zh-cn.js", ENDITEM,
"URL=skin/default/datepicker.css", ENDITEM,
"URL=skin/whyGreen/datepicker.css", ENDITEM,
"URL=skin/default/img.gif", ENDITEM,
LAST);
lr_think_time(2);
web_cleanup_auto_headers();
web_cache_cleanup();
//开始查询
web_url("blank.htm",
"URL=http://192.168.16.69:8080/trsmconsole/trsm/report/blank.htm?Operatingtime_BEGIN=2004-04-28%252010%253A32%253A59&Operatingtime_END=2009-05-05%252010%253A32%253A59&ServerRecevingTime_BEGIN=2004-04-28%252010%253A32%253A59&ServerRecevingTime_END=2009-05-05%252010%253A32%253A59&&RptType=LOG_9-1-1-1&winTitle=%u53EF%u4FE1%u79FB%u52A8%u4F7F%u7528%u53F0%u5E10-%u6570%u636E",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
web_custom_request("ReportAction.do",
"URL=http://192.168.16.69:8080/trsmconsole/trsm/report/ReportAction.do?Operatingtime_BEGIN=2004-04-28%252010%253A32%253A59&Operatingtime_END=2009-05-05%252010%253A32%253A59&ServerRecevingTime_BEGIN=2004-04-28%252010%253A32%253A59&ServerRecevingTime_END=2009-05-05%252010%253A32%253A59&&RptType=LOG_9-1-1-1&winTitle=%u53EF%u4FE1%u79FB%u52A8%u4F7F%u7528%u53F0%u5E10-%u6570%u636E&Ajax=true",
"Method=POST",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/blank.htm?Operatingtime_BEGIN=2004-04-28%252010%253A32%253A59&Operatingtime_END=2009-05-05%252010%253A32%253A59&ServerRecevingTime_BEGIN=2004-04-28%252010%253A32%253A59&ServerRecevingTime_END=2009-05-05%252010%253A32%253A59&&RptType=LOG_9-1-1-1&winTitle=%u53EF%u4FE1%u79FB%u52A8%u4F7F%u7528%u53F0%u5E10-%u6570%u636E",
"Snapshot=t8.inf",
"Mode=HTML",
"EncType=",
"Body= ",
LAST);
web_reg_find("Text=100条",
"Fail=NotFound",
LAST); //查找网页中是否有“100条”这几个字符
web_url("TrustDiskAuth-viewer.jsp",
"URL=http://192.168.16.69:8080/trsmconsole/trsm/report/TrustDiskAuth-viewer.jsp?RptFile=UsingLogReport.rpt&RptClassName=com.css.waterbox.trsm.businessbean.Auditlog.Data.UsingLogBean&RptTableAlias=UsingLogBean",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.16.69:8080/trsmconsole/trsm/report/blank.htm?Operatingtime_BEGIN=2004-04-28%252010%253A32%253A59&Operatingtime_END=2009-05-05%252010%253A32%253A59&ServerRecevingTime_BEGIN=2004-04-28%252010%253A32%253A59&ServerRecevingTime_END=2009-05-05%252010%253A32%253A59&&RptType=LOG_9-1-1-1&winTitle=%u53EF%u4FE1%u79FB%u52A8%u4F7F%u7528%u53F0%u5E10-%u6570%u636E",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
return 0;
}
[ 本帖最后由 kkwwpp 于 2009-5-7 11:32 编辑 ] |
|