|
TDD的脚本:
table = "f:\\wrtest\\login.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", 2);
button_press ("开始");
# BaseBar
set_window ("BaseBar", 13);
toolbar_select_item ("ToolbarWindow32_1", "程序(P);WinRunner;Sample Applications;Flight 4A");
# Login
set_window ("Login", 13);
edit_set ("Agent Name:", ddt_val(table,"name"));
password_edit_set("Password:", ddt_val(table,"password"));
button_press ("OK");
#judge the "Flight Reservation" object whether is exists
if(win_exists("Flight Reservation")==E_NOT_FOUND)
{
report_msg("Flight Reservation is not find!");
win_close("Flight Reservations");
win_close("Login");
}
else
win_close ("Flight Reservation");
}
ddt_close(table);
上面兰色的为判断窗体“Flight Reservation”找不到的时候,抛出错误报告,然后关闭其他窗体
但是我在运行的时候,好象条件都不成立,就是找得到窗体或找不到都执行if与else的语句,而不根据条件来执行。
郁闷,请高手帮下忙!~!
下面附件为gui文件:
下面为数据表:
|
|