|
2#
楼主 |
发表于 2012-11-16 09:57:10
|
只看该作者
table = "e:\\新建 microsoft excel 工作表.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);
table = table;
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", 1);
button_press ("开始");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "程序(P);WinRunner;Sample Applications;Flight 4A");
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", ddt_val(table,"用户名"));
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 6);
obj_type ("MSMaskWndClass","020206");
list_select_item ("Fly From:", "Frankfurt"); # Item Number 1;
list_select_item ("Fly To:", "London"); # Item Number 1;
obj_mouse_click ("FLIGHT", 37, 26, LEFT);
# Flights Table
set_window ("Flights Table", 0);
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 3);
edit_set ("Name:", "lk");
button_press ("Insert Order");
win_close ("Flight Reservation");
}
ddt_close(table);
}
ddt_close(table);
附上代码,谢谢了 |
|