|
Wr测试数据出错!
table = "lesson8.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);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 4;
# Flight Reservation
set_window ("Flight Reservation", 2);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 1);
button_set ("Order No.", ON);
#obj_check_gui("Edit_1", "list1.ckl", "gui1", 1);
edit_set ("Edit_1", ddt_val(table,"Order_num"));
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 2);
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,"correct."tickets "ticket(s) at $"price"cost $"total".");
else
tl_step("total",1,"incorrect."tickets" ticket(s) at $"price "doesn't equal $"total".");
tl_step("pass",0,tickets*price"="total"?");
button_press ("Cancel");
}
ddt_close(table);
这是对WR自带的例子“Flight Reservation”测试时的脚本,在进行循环测试时,lesson8.xls里的数据为order no从1-12,为什么其它都对,就当order no 为2时不能pass,而且不管把“2”放在什么位置都会出错,可其实软件没有问题,tickets*price=total。我确实想不明白。不知有没有人碰上过,是不是WR本身有问题,呵呵,请高手指教!
[ Last edited by lbdfg on 2005-4-30 at 17:57 ] |
|