看到一个 Flight 4A 登陆的测试程序,我运行有问题!
table = "e2.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);
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", ddt_val(table,"Login_Name"));
edit_get_row_length("Agent Name:",4,len);
if(len < 4)
{
tl_step("login",1,"name is incorrect");
continue;
}
else
tl_step("login",0,"name is correct");
password_edit_set("Password:", ddt_val(table,"password1"));
edit_get_row_length("Password:",4,len);
if(len < 4)
{
tl_step("password1",1,"password length incorrect");
continue;
}
else
{
edit_get_text("Password:",text);
if(text!="mercury")
{
tl_step("password1",1,"password is incorrect");
continue;
}
else
tl_step("password1",0,"password is correct");
}
button_press ("OK");
# Flight Reservation
win_close ("Flight Reservation");
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("开始");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "程序(P);WinRunner;Sample Applications;Flight 4A");
}
ddt_close(table); |