51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2139|回复: 2
打印 上一主题 下一主题

我怎么总是碰上怪问题?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2005-4-30 17:52:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
# Shell_TrayWnd
#        set_window ("Shell_TrayWnd", 4);
#        toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 2;

# Flight Reservation
        set_window ("Flight Reservation", 6);
        menu_select_item ("Analysis;Graphs...");

# Graph
        set_window("Graph", 10);
        obj_get_text("GS_Drawing", first, 226, 210, 241, 225);        #  34
        tl_step("print",0,first);


# Shell_TrayWnd
        set_window ("Shell_TrayWnd", 5);
        toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 2;

# Graph
        win_close ("Graph");

# Flight Reservation
        set_window ("Flight Reservation", 3);
        menu_select_item ("File;New Order");
        obj_type ("MSMaskWndClass","01<kBackSpace>50105");
        list_select_item ("Fly From:", "Denver");  # Item Number 0;
        list_select_item ("Fly To:", "London");  # Item Number 1;
        obj_mouse_click ("FLIGHT", 16, 33, LEFT);

# Flights Table
        set_window ("Flights Table", 2);
        list_activate_item ("Flight", "20261   DEN   09:12 AM   LON   04:23 PM   AA     $112.20"); # Item Number 1;

# Flight Reservation
        set_window ("Flight Reservation", 7);
        edit_set ("Name:", "tt");
        button_set ("First", ON);
        button_press ("Insert Order");

# Shell_TrayWnd
        set_window ("Shell_TrayWnd", 39);
        toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 2;

# Flight Reservation
        set_window ("Flight Reservation", 9);
        obj_wait_bitmap("Insert Done...", "Img3", 1);
        menu_select_item ("Analysis;Graphs...");

# Graph
        set_window("Graph", 8);
        obj_get_text("GS_Drawing", new, 228, 209, 242, 223);        #  35
        tl_step("print",0,new);
       

# Shell_TrayWnd
        set_window ("Shell_TrayWnd", 11);
        toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 2;

# Graph
        win_close ("Graph");
# Check if tickets sold increase 1
       
        if(new == first+1)
                tl_step("total",0,"correct" new "," first);
        else
                tl_step("total",1,"incorrect" new "," first);

从Graph上取text,又是if问题,在进入if时它认为new!=first+1,在显示结果时确又确实显示的new比first大一,怎么回事?怪

[ Last edited by lbdfg on 2005-4-30 at 18:20 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏

该用户从未签到

2#
发表于 2005-5-6 23:39:23 | 只看该作者
if(new == first+1)
                tl_step("total",0,"correct" new "," first);
        else
                tl_step("total",1,"incorrect" new "," first);

修改一下脚本:

if(new == (first+1))
                tl_step("total",0,"correct" new "," first);
else
                tl_step("total",1,"incorrect" new "," first);
调试下

调试脚本把变量new和first 在运行过程中打印出来,看看最后结果是什么
然后找原因
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2005-5-9 08:23:34 | 只看该作者
哈哈,原来这样啊,明白了
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-26 15:28 , Processed in 0.069926 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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