|
在一次软件测试中,遇到个这样的问题:
(1)初始录制的代码如下:
# 系统(主程序)
set_window ("系统(主程序)", 1);
button_press ("登录与锁定");
# 系统(主程序)
set_window ("泰系统(主程序)", 6);
list_select_item ("SysListView32", "锁定设置");
button_press ("Button");
button_press ("应用(A)");
# 设置
set_window ("设置", 0);
button_press ("确定");
# 系统(主程序)
set_window ("系统(主程序)", 1);
button_press ("√_5");[\color]
button_press ("应用(A)");
# 设置
set_window ("设置", 0);
button_press ("确定");
问题:能否将button_press(button)中的button参数化?
(2)方案1:
修改后的程序如下:
public function _button_press(in RowCount,count)
{
static table1,rc,table1_Row,table1_RowCount;
table1="字符输入表.xls";
rc=ddt_open(table1,DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
table1_Row=RowCount;
table1_RowCount=count;
for(table1_Row; table1_Row <= table1_RowCount; table1_Row ++)
{
ddt_set_row(table1,table1_Row);
# 系统(主程序)
set_window ("系统(主程序)", 1);
button_press ("登录与锁定");
# 泰谷终端安全与文件保护系统(主程序)
set_window ("系统(主程序)", 6);
list_select_item ("SysListView32", "锁定设置");
button_press (ddt_val(table1, "button"));[\red]
button_press ("应用(A)");
# 设置
set_window ("设置", 0);
button_press ("确定");
}
ddt_close(table1);
}
table1:
-------------------------------------------------------------
table1_Row button
-------------------------------------------------------------
1 "button"
-------------------------------------------------------------
2 "√_5"
-------------------------------------------------------------
run:
(1)找不到button
(2)提示出现”巫师“,学习”continue"后可继续执行
(3)每次循环均出现类似情况 |
|