|
真厉害,反映就是快啊!向你学习!!以后多指教啊!
下面把完整通过的脚本贴出来!
#加载GUI
GUI_unload_all()
GUI_load("d:\\wrtest\\yanzhengjieguo\\gui.gui");
#数据驱动
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);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
button_press ("Start");
# BaseBar
set_window ("BaseBar", 7);
toolbar_select_item ("ToolbarWindow32_1", "程序(P);附件;计算器");
# 计算器
win_type ("计算器",ddt_val(table, "t1") );
set_window ("计算器", 0);
obj_mouse_click ("Button", 21, 13, LEFT);
obj_type ("Button",ddt_val(table, "t2") );
obj_mouse_click ("Button_1", 24, 17, LEFT);
obj_get_text("LABLE1",test);
obj_mouse_click ("Button_2", 54, 9, LEFT);
win_close ("计算器");
# 判断结果
line1=ddt_val(table,"t1");
line2=ddt_val(table,"t2");
line3=line1*line2;
if(test-line3 == 0)
report_msg("line1="line1",line2="line2",test="test",line3="line3",right.");
else
report_msg("line1="line1",line2="line2",test="test",line3="line3",wrong.");
}
ddt_close(table); |
|