|
小妹的目的:在开始-》WINRUNNER-》SAMPLE APPLICATIONS-》FLIGHT 4A中订从Paris到London的机票,要求能够每次都从已经做好的数据表中取数据。数据表default.xls如下:
Flight From Departure To Arrival Airline Price
10353 PAR 11:20 AM LON 12:43 PM SR $168.20
10503 PAR 8:00 AM LON 10:30 AM AF $123.47
10506 PAR 10:24 AM LON 11:24 AM AF $126.47
我RUN一次下面的脚本,只要求买一张机票。比如我想买Flight 10503这张机票,下面中的问号该用什么来代替?小妹拜求高手给个答案。
我的脚本如下:
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 3);
button_press ("Start");
# BaseBar
set_window ("BaseBar", 4);
toolbar_select_item ("ToolbarWindow32_1", "程序(P);WinRunner;Sample Applications;Flight 4A");
# Login
set_window ("Login", 3);
obj_type ("Agent Name:","<kCtrl_L-kShift_L>");
edit_set ("Agent Name:", "sandy");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
obj_type ("Password:","<kReturn>");
# Flight Reservation
set_window ("Flight Reservation", 32);
edit_set ("Date of Flight:", "06/02/21");
list_select_item ("Fly From:", "Paris"); # Item Number 4;
list_select_item ("Fly To:", "London"); # Item Number 2;
obj_mouse_click ("FLIGHT", 34, 28, LEFT);
# Flights Table
set_window ("Flights Table", 1);
table = "default.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);
list_select_item ("Flight", "???");
button_press ("OK");
}
ddt_close(table);
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 4);
edit_set ("Name:", "sandy");
button_press ("Insert Order"); |
|