51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1723|回复: 5
打印 上一主题 下一主题

[原创] web_reg_find函数能找到检查点,count=0,这是为什么

[复制链接]
  • TA的每日心情
    擦汗
    2015-11-11 15:40
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2015-11-19 15:52:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

            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.
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2015-12-11 09:58
  • 签到天数: 38 天

    连续签到: 2 天

    [LV.5]测试团长

    2#
    发表于 2015-11-20 11:54:28 | 只看该作者
    找到的数量是0个,应该还是没有找到。

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 恭喜你获得测试积点10

    查看全部评分

    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2015-11-11 15:40
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    3#
     楼主| 发表于 2015-11-20 12:10:30 | 只看该作者
    zhuruize 发表于 2015-11-20 11:54
    找到的数量是0个,应该还是没有找到。

    嗯,不知道为什么总是找不到 也进行中文转码了
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2015-12-11 09:58
  • 签到天数: 38 天

    连续签到: 2 天

    [LV.5]测试团长

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

    打印一下你这个要找的变量,看对不对;
    另外能的话换一个其它的试试。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2015-11-11 15:40
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    5#
     楼主| 发表于 2015-11-23 14:28:38 | 只看该作者
    问题已解决
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2015-11-11 15:40
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    6#
     楼主| 发表于 2015-11-24 16:29:01 | 只看该作者
    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).
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-7 07:39 , Processed in 0.065524 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表