|
先来描述一下错误出现的情况
首先的运行run from top的时候出现了 execution has been suspend in d:\filename changing flow will destory the context " for statement " being executed
然后点击“确定”
运行的时候出现的错误是 winrunner can't find the window" Fax Order No.3"
以下是我的运行的脚本代码 使用的是winrunner 8.2
我已经把Fax Order No.3 已经修改成了!Fax Order No.* 在GUI FILES里面
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("Fax Order No. 3", 1);
set_window ("Shell_TrayWnd", 2);
toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 4;
# 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");
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 2);
toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 4;
# Flight Reservation
set_window ("Flight Reservation", 6);
menu_select_item ("File;Fax Order...");
#注意这里的 Fax Order No. 3 是不会随着循环的改变而改变的
set_window("Fax Order No.3", 1);
edit_get_text("Ticket Price:",price);
edit_get_text("# Tickets:",tickets);
edit_get_text("Total:",total);
if(price*tickets == total)
tl_step("total",0,"total is correct.");
else
tl_step("total",1,"total is not correct.");
button_press ("Cancel");
}
ddt_close(table); |
|