感谢楼上两位的,还不是很明白,我再看看!
我目前的做法是这样的,可是觉得这样写很奇怪,用table_Row来标识输入,好象很傻呀
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);
set_window("聚合首页 - 集美学村bbs站 - Powered by Discuz!NT",121);
edit_set("username",ddt_val(table,"username"));
password_edit_set("password",ddt_val(table,"password"));
button_press("登录");
if(table_Row==1){
#用户名存在且密码正确
obj_check_info("用户中心","enabled",1,10);
obj_check_info("短消息","enabled",1,10);
obj_check_info("进入BBS","enabled",1,10);
web_frame_text_exists("聚合首页 - 集美学村bbs站 - Powered by Discuz!NT","欢迎您 ATHuang","前身北洋大学\.\.\. 详细 ","\[ 退出");
obj_check_info("退出","enabled",1,10);
obj_check_info("帮助","enabled",1,10);
# 聚合首页 - 集美学村bbs站 - Powered by Discuz!NT
set_window("聚合首页 - 集美学村bbs站 - Powered by Discuz!NT",44);
web_link_click("退出");
}else if(table_Row==2){
#用户名不存在
web_frame_text_exists("用户登录 - 集美学村bbs站 - Powered by Discuz!NT","用户不存在","户登录出现了1个错误"," 返回上一步");
# Browser Main Window
set_window ("Browser Main Window", 4);
edit_set ("browser_main_edit_location", "http://bbs.jmu.edu.cn");
toolbar_button_press("MainToolBar_2","Back");
}else if(table_Row==3){
#用户名存在但密码错误
web_frame_text_exists("用户登录 - 集美学村bbs站 - Powered by Discuz!NT","密码或安全提问第1次错误, 您最多有5次机会重试","户登录出现了1个错误"," 返回上一步");
# Browser Main Window
set_window ("Browser Main Window", 4);
edit_set ("browser_main_edit_location", "http://bbs.jmu.edu.cn");
toolbar_button_press("MainToolBar_2","Back");
}else{
# Browser Main Window
set_window ("Browser Main Window", 4);
edit_set ("browser_main_edit_location", "http://bbs.jmu.edu.cn");
toolbar_button_press("MainToolBar_2","Back");
}
}
ddt_close(table);
[ 本帖最后由 婧子 于 2008-4-21 10:03 编辑 ] |