51Testing软件测试论坛

标题: 请教一个regular expression 的问题! [打印本页]

作者: peterzhu    时间: 2006-7-26 19:24
标题: 请教一个regular expression 的问题!
这是我的测试脚本:

table = "lesson9.xls";
rc = ddt_open(table, DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
        pause("Cannot open table.");
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
        ddt_set_row(table,table_Row);
       
        # Flight Reservation
                win_activate ("Flight Reservation");
                set_window ("Flight Reservation", 0);
                menu_select_item ("File;Open Order...");
       
        # Open Order
                set_window ("Open Order", 1);
                button_set ("Order No.", ON);
                edit_set ("Edit_1", ddt_val(table,"Order_Num"));
                button_press ("OK");
       
        # Flight Reservation
                set_window ("Flight Reservation", 3);
                menu_select_item ("File;Fax Order...");
       
   # Fax Order No. 3
                set_window ("Fax Order No. 3", 3);                edit_get_text("# Tickets:",tickets);
            edit_get_text("Ticket Price:",price);
            edit_get_text("Total:",total);
        #        check that the total ticket price is calculated correctly.
                if(tickets*price == total)
                    tl_step("total",0,"total is correct.");
                else
                    tl_step("total",1,"total is incorrect");
                button_press ("Cancel");
       
}
ddt_close(table);

该脚本是对WR自带的样例Flight 4A的多个定单进行测试,以验证票数乘已机票单价是否会等于总数.我数据表的数据是3,4,5,6.

在程序运行过程中,因为Fax Order No传真窗口的lable会发生变化,所以我将Fax Order No. 3的GUI Map改成了

{
class: window,
label: "!Fax Order No. *",
MSW_class: "#32770"
}

可是为什么执行到set_window ("Fax Order No. 3", 3)时报错,说找不到Fax Order No. 3这个窗口

是不是改Map时改错了  "label: "!Fax Order No. *"  
应当怎么处理?请各位支招.
作者: peterzhu    时间: 2006-7-26 23:54
耶,问题解决了,
原来是label: "!Fax Order No. *", *前面多了个空格,郁闷哪

class: window,
label: "!Fax Order No. *",
MSW_class: "#32770"
}




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