TA的每日心情 | 奋斗 2015-11-17 09:09 |
---|
签到天数: 7 天 连续签到: 1 天 [LV.3]测试连长
|
回复 #3 jasmine2000 的帖子
以下脚本可运行(WR自带的Flight 4A,WR V7.6,WinXP SP2):
table = "text.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
set_window ("Flight Reservation", 4);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 1);
state=ddt_val(table, "State");
pause(state);
if(state =="ON")
{
button_set ("Order No.",state);
edit_set ("Edit", 3);
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", 1);
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" Tickets at $"price" cost $"total".");
else
tl_step("total", 0, "Error. "tickets" Tickets at $"price" does not equal $"total".");
button_press ("Cancel");
}
else{
win_close("Open Order");
}
}
ddt_close(table);
text.xls数据如下:
State
OFF
ON
仅供参考!
[ 本帖最后由 gp_jl 于 2006-11-10 23:02 编辑 ] |
|