数据驱动的一个问题
table = "houlai.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);
# Program Manager
set_window ("Program Manager", 2);
list_activate_item ("SysListView32", "Flight 4A");
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 3);
toolbar_button_press ("ToolbarWindow32_1", "Login"); # Button Number 5;
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", "sdfsf");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
obj_type ("Password:","<kReturn>");
# Flight Reservation
set_window ("Flight Reservation", 9);
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,"lalala"));
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 1);
menu_select_item ("File;Fax Order...");
set_window("Fax Order No. 3", 1);
edit_get_text("# Tickets:",Tickets);
edit_get_text("Ticket Price:",Price);
edit_get_text("Total:",Total);
if(Tickets*Price == Total)
tl_step("total",0, "total is correct.");
else
tl_step("total",1, "total is incorrect");
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 2);
toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 5;
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 3);
toolbar_button_press ("ToolbarWindow32_1", "Flight Reservation"); # Button Number 6;
# Fax Order No. 3
win_close ("Fax Order No. 3");
# Flight Reservation
win_close ("Flight Reservation");
}
ddt_close(table); 请高手指点这段代码有什么问题呀?
错误提示
Window: "Program Manager"Object: "SysListView32"Error: Object is not currently displayed. 错误发生在这个地方list_activate_item ("SysListView32", "Flight 4A"); 我是将 Fax Order No. 3的label改成: "!Fax Order No.*",后发生了这种错误,但是不改也不行因为参数化到下一个值的时候label会改变。 等待中。。。。。。 在线等希望知道的朋友 帮个忙 谢谢了先 我是将 Fax Order No. 3的label改成: "!Fax Order No.*",
这个没改好 ???楼主先看看你对这个控件的修改是否正确。
我觉得会不会是在set_window ("Program Manager", 2);这个地方.你下次的参数化到下一个值的时候前提???
可能是list_activate_item ("SysListView32", "Flight 4A");这个之前的语句出问题.
[ 本帖最后由 win3323 于 2007-9-12 17:58 编辑 ]
回复 #8 win3323 的帖子
是要加叹号的呀 要不就不对了回复 #3 npy912 的帖子
首先判断确实有SysListView32这个对象吗?有的话,set时间长点试下。 lz是把从windows点击打开软件的操作都一起录制了吧,建议改为invoke_application()函数启动程序,对windows的操作回放起来可靠性不高 多谢 版主正是此问题sdlkfj2
页:
[1]