测试WINDONS通信薄~~窗口属性问题 !~~~
录制WINDONS通讯薄时 填加新用户窗口属性会随之改变
姓:1 名:2
在WinRunner下就会是 "1 2 属性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);
# 通讯簿 - 主标识
set_window ("通讯簿 - 主标识", 4);
menu_select_item ("文件(F);新建联系人(C)... Ctrl+N");
# noname (page)
set_window ("noname (page)", 31);
edit_set ("姓(L):", ddt_val(table,"z"));
edit_set ("名(F):", ddt_val(table,"yp"));
edit_set ("职务(T):", ddt_val(table,"s"));
edit_set ("昵称(N):", ddt_val(table,"hzz"));
obj_check_gui("添加(A)", "list1.ckl", "gui1", 6);
obj_check_gui("编辑(E)", "list2.ckl", "gui2", 1);
obj_check_gui("删除(R)", "list3.ckl", "gui3", 1);
obj_check_gui("设为默认值(S)", "list4.ckl", "gui4", 1);
set_window ("noname (page)", 16);
edit_set ("电子邮件地址(M):_0", ddt_val(table,"email"));
obj_check_gui("添加(A)", "list5.ckl", "gui5", 0);
set_window ("noname (page)", 5);
button_press ("添加(A)");
# 判断输入E-mail是否正确
if(win_exists("!.* 属性_1",2)==E_OK)
{
set_window ("!.* 属性_1", 0);
button_press ("否(N)");
# noname (page)
set_window("noname (page)", 2);
obj_check_gui("编辑(E)", "list13.ckl", "gui13", 1);
obj_check_gui("删除(R)", "list14.ckl", "gui14", 1);
obj_check_gui("设为默认值(S)", "list15.ckl", "gui15", 1);
set_window ("1 2 属性_2", 2);
button_press ("取消");
continue;
}
obj_check_gui("添加(A)", "list6.ckl", "gui6", 2);
obj_check_gui("编辑(E)", "list7.ckl", "gui7", 0);
obj_check_gui("删除(R)", "list8.ckl", "gui8", 1);
obj_check_gui("设为默认值(S)", "list9.ckl", "gui9", 1);
# z yp 属性
set_window ("z yp 属性", 12);
button_press ("确定");
}
ddt_close(table); 就是这里!~~~
谢谢!~~~ 方法是在label:""中添加!.*,比如有3个窗口win123,win325,win999,就在里面改成!win.*。依此类推。
是否这样写就可以拉
set_window ("!.* 属性_1", 0); 我修改后
运行到
if(win_exists("!.*属性_1",2)==E_OK)
这里 总是让学习GUI
这是什么问题哇~~~~ 在脚本中引用的逻辑名称不用改,只需要把GUI map 中的窗体“1 2 属性 1”的“label”属性修改成“!.*属性_1”。然后再把你脚本中类似于“ if(win_exists("!.* 属性_1",2)==E_OK)”中的“!.*属性_1”改成“1 2 属性_1”,应该就可以了。
[ 本帖最后由 shiwomyw 于 2006-11-28 15:59 编辑 ] 谢谢!~:)
解决拉!~~sdlkfj2
页:
[1]