|
4#
楼主 |
发表于 2009-6-25 10:32:29
|
只看该作者
table = "lsson8.xls";
rc = ddt_open(table, DDT_MODE_READ);#ddt_open(data_table_name [ , mode ] =>mode分为DDT_MODE_READ(read-only)、DDT_MODE_READWRITE (read or write)。mode 默认为DDT_MODE_READ
if (rc!= E_OK && rc != E_FILE_OPEN)#E_OK 0 Operation successful---E_FILE_OPEN -10007 Cannot open file. File may already be 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
set_window ("Flight Reservation", 3);
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");
wait(1);
if(win_exists("Flight Reservations")!=E_OK)
{
# Flight Reservation
set_window ("Flight Reservation", 3);
menu_select_item ("File;Fax Order...");
# Fax Order No. 3
set_window ("Fax Order No. 3", 1);
edit_get_text("# Tickets:",tickets);
edit_get_text("Ticket Price:",price);
edit_get_text("Total:",total);
#tl_step ( step_name, status, description );把测试脚本分成几块,并在当前测试结果里插入状态信息
#Set to 0 for pass, or any other integer for failure.
if(tickets*price==total)
tl_step("总计测试",0,"正确.Order_Num为"ddt_val(table,"Order_Num")":"tickets" 张票,每张 $ "price",总计 $"total".");
else
tl_step("总计测试",1,"Error.Order_Num为"ddt_val(table,"Order_Num")":"tickets" tickets at $ "price" does not equal $"total".");
button_press ("Cancel");
}
else
{
report_msg("Order_Num为"ddt_val(table,"Order_Num")"查询不到数据");
set_window ("Flight Reservations", 3);
button_press ("确定");
set_window ("Open Order", 3);
button_press ("Cancel");
}
}
ddt_close(table); |
|