51Testing软件测试论坛

标题: web_reg_find函数能找到检查点,count=0,这是为什么 [打印本页]

作者: 远方的小企鹅    时间: 2015-11-19 15:52
标题: web_reg_find函数能找到检查点,count=0,这是为什么

        web_add_cookie("cna=4vNJDlAYFTwCAbeDAMm/GgD6; DOMAIN=z1.cnzz.com");

        web_add_cookie("cna=4vNJDlAYFTwCAbeDAMm/GgD6; DOMAIN=c.cnzz.com");

   
    lr_convert_string_encoding( "在线作业",LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"str" );
               
   lr_save_string(lr_eval_string("{str}"),"a");
               
        web_reg_find("Text={a},"
                                 "Search=ALL",
                     "SaveCount=Count",
                LAST);
       
        web_url("www.zuihuixue.com",
                "URL=http://www.zuihuixue.com/",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t3.inf",
                "Mode=HTML",
                LAST);

        lr_think_time(128);
   
        lr_start_transaction("登录");


        web_submit_data("login",
                "Action=http://www.zuihuixue.com/login",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=application/json",
                "Referer=http://www.zuihuixue.com/",
                "Snapshot=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=subjects", "Value={\"8a489d1a4637f67a014660ae9d4a03b2\":206}", ENDITEM,
                "Name=username", "Value={username}", ENDITEM,
                "Name=password", "Value={password}", ENDITEM,
                LAST);

//web_reg_find("Text=首页 - 最慧学",
//LAST);

        web_url("www.zuihuixue.com_2",
                "URL=http://www.zuihuixue.com/",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://www.zuihuixue.com/",
                "Snapshot=t5.inf",
                "Mode=HTML",
                LAST);


   if(atoi( lr_eval_string("{Count}"))>0){
        lr_output_message("Logon ");
   }else{
        lr_output_message("fail");
   }
       

        lr_end_transaction("登录", LR_AUTO);


       
return 0;
}



回放日志:
Action.c(23): Notify: Saving Parameter "str = 鍦ㄧ嚎浣滀笟\x00".
Action.c(25): Notify: Parameter Substitution: parameter "str" =  "鍦ㄧ嚎浣滀笟\x00"
Action.c(25): Notify: Saving Parameter "a = 鍦ㄧ嚎浣滀笟".
Action.c(27): Notify: Parameter Substitution: parameter "a" =  "鍦ㄧ嚎浣滀笟"
Action.c(27): Registering web_reg_find was successful          [MsgId: MMSG-26390]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/css/global_new.min.0a3c674e.css" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/css/user/login2.min.c8e42181.css" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/js/global_new.min.d56a146c.js" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/js/zhx.min.3836cd91.js" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/img/icons/girl.svg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/img/icons/shirt.svg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Found resource "http://img.zuihuixue.com/clearn/assets/img/icons/medal.svg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(32): Registered web_reg_find successful for "Text=鍦ㄧ嚎浣滀笟,Search=ALL"          [MsgId: MMSG-26362]
Action.c(32): Notify: Saving Parameter "Count = 0".
Action.c(32): web_url("www.zuihuixue.com") was successful, 298738 body bytes, 4513 header bytes, 364 chunking overhead bytes          [MsgId: MMSG-26385]
Action.c(44): Notify: Transaction "登录" started.
Action.c(47): Warning: The string '"8a489d1a4637f67a014660ae9d4a03b2":206' with parameter delimiters is not a parameter.
Action.c(47): Notify: Parameter Substitution: parameter "username" =  "100066"
Action.c(47): Notify: Next row for parameter password = 2 [table  = password].
Action.c(47): Notify: Getting new value for parameter 'password': table = 'username.dat' column = '1' row = '2'.
Action.c(47): Notify: Parameter Substitution: parameter "password" =  "a123456"
Action.c(47): web_submit_data("login") was successful, 80 body bytes, 503 header bytes, 11 chunking overhead bytes          [MsgId: MMSG-26385]
Action.c(64): Resource "http://img.zuihuixue.com/clearn/assets/css/global_new.min.0a3c674e.css" is in the cache already and will not be downloaded again          [MsgId: MMSG-26655]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/css/hx-desktop.min.e237e9be.css" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Resource "http://img.zuihuixue.com/clearn/assets/js/global_new.min.d56a146c.js" is in the cache already and will not be downloaded again          [MsgId: MMSG-26655]
Action.c(64): Resource "http://img.zuihuixue.com/clearn/assets/js/zhx.min.3836cd91.js" is in the cache already and will not be downloaded again          [MsgId: MMSG-26655]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/js/hx-qa.min.aef1cfca.js" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/upload/event/improve.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_qamatch.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_zlwd_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/myhomewk.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_hxt.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_hxt_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_zy.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_zy_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_zb.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_zb_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_xsh.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_xsh_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_wkt.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_wkt_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_jjc.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_jjc_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_qtw.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/assets/img/student/desktop/online_qtw_hv.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/upload/avatar/10/0/100066_s_4.jpg" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://img.zuihuixue.com/clearn/zhx-weixin-qrc.png" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Found resource "http://wpa.qq.com/pa?p=2:2738934451:52" in HTML "http://www.zuihuixue.com/"          [MsgId: MMSG-26659]
Action.c(64): Redirecting "http://wpa.qq.com/pa?p=2:2738934451:52" (redirection depth is 0)          [MsgId: MMSG-26694]
Action.c(64): To location "http://pub.idqqimg.com/qconn/wpa/button/button_121.gif"          [MsgId: MMSG-26693]
Action.c(64): web_url("www.zuihuixue.com_2") was successful, 198497 body bytes, 13567 header bytes, 98 chunking overhead bytes          [MsgId: MMSG-26385]
Action.c(75): Notify: Parameter Substitution: parameter "Count" =  "0"
Action.c(78): fail
Action.c(82): Notify: Transaction "登录" ended with "Pass" status (Duration: 1.5743 Wasted Time: 0.0370).
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
作者: zhuruize    时间: 2015-11-20 11:54
找到的数量是0个,应该还是没有找到。
作者: 远方的小企鹅    时间: 2015-11-20 12:10
zhuruize 发表于 2015-11-20 11:54
找到的数量是0个,应该还是没有找到。

嗯,不知道为什么总是找不到 也进行中文转码了
作者: zhuruize    时间: 2015-11-20 16:56
远方的小企鹅 发表于 2015-11-20 12:10
嗯,不知道为什么总是找不到 也进行中文转码了

打印一下你这个要找的变量,看对不对;
另外能的话换一个其它的试试。
作者: 远方的小企鹅    时间: 2015-11-23 14:28
问题已解决
作者: 远方的小企鹅    时间: 2015-11-24 16:29
zhuruize 发表于 2015-11-20 16:56
打印一下你这个要找的变量,看对不对;
另外能的话换一个其它的试试。

我打印出来的一样:
Action.c(63): Registered web_reg_find successful for "Text=鍦ㄧ嚎浣滀笟"          [MsgId: MMSG-26362]
Action.c(63): Notify: Saving Parameter "Count = 0".
Action.c(63): web_url("www.zuihuixue.com_2") was successful, 187654 body bytes, 14614 header bytes, 131 chunking overhead bytes          [MsgId: MMSG-26385]
Action.c(73): Notify: Parameter Substitution: parameter "Count" =  "0"


Action.c(82): Notify: Parameter Substitution: parameter "a" =  "鍦ㄧ嚎浣滀笟"
Action.c(82): 登录状态:用户名--100066,用户名密码--a123456,在线作业--鍦ㄧ嚎浣滀笟
Action.c(85): Notify: Transaction "提交" ended with "Fail" status (Duration: 1.9899 Wasted Time: 0.0455).




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2