51Testing软件测试论坛
标题:
list选项识别的范围(所有选项或只是显示的选项)??
[打印本页]
作者:
vonsy
时间:
2006-6-15 15:28
标题:
list选项识别的范围(所有选项或只是显示的选项)??
列表有20选项. 一次(小窗口)显示4个。
于是winrunner录下的scrip 列表选项范围只是1--4.
我是用循环实现的。昨解决呢??
谢谢各位..
win_activate ("±à¼");
set_window ("±à¼", 1);
edit_set_insert_pos ("dw_1.code", 0, 0);
obj_type ("dw_1.code","001");
tbl_set_selected_cell ("dw_1", "#1", "name");
obj_type ("dw_1.name","00000001");
tbl_set_selected_cell ("dw_1", "#1", "shortcut");
obj_mouse_click ("uo_new", 26, 28, LEFT);
tbl_set_selected_cell ("dw_detail", "#1", "IDAsInfo2");
tbl_set_cell_data ("dw_detail", "#1", "IDAsInfo2", "ǧ¿Ë");
obj_mouse_drag ("uo_new", 32, 31, 33, 31, LEFT);
tbl_set_selected_cell ("dw_detail", "#2", "IDAsInfo2");
tbl_set_cell_data ("dw_detail", "#2", "IDAsInfo2", "¹«½ï");
obj_mouse_click ("uo_new", 37, 29, LEFT);
tbl_set_selected_cell ("dw_detail", "#3", "IDAsInfo2");
tbl_set_cell_data ("dw_detail", "#3", "IDAsInfo2", "Æ¿");
obj_mouse_drag ("uo_new", 31, 35, 31, 36, LEFT);
tbl_set_selected_cell ("dw_detail", "#4", "IDAsInfo2");
tbl_set_cell_data ("dw_detail", "#4", "IDAsInfo2", "¸ö");
obj_mouse_click ("uo_new", 23, 35, LEFT);
obj_mouse_click ("dw_detail.IDAsInfo2", 114, 15);
tbl_set_cell_data ("dw_detail", "#5", "IDAsInfo2", "±");
tbl_set_selected_cell ("dw_detail", "#1", "SecPro");
作者:
vonsy
时间:
2006-6-15 15:42
# µ¥Î»×é
# δÍê³É.........................»ñµÃϵͳÐÅÏ¢´íÎó.!!!!!!!!
# June 08 2006
# ÎҵŤ×÷
win_activate ("ÎҵŤ×÷");
set_window ("ÎҵŤ×÷", 1);
tbl_activate_cell ("mywork.dw_1", "#8", "ShowName");
# µ¥Î»×é
static UnitTypeNum[ ] = {4, 6, 4, 6};
begin=1;
end = 0;
# Íâ²ãÑ»· µ¥Î»×éµÄ´óÀà.
table = "power_unit_type.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 ++)
{
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
TypeID = ddt_val_by_row(table, table_Row, "TypeID");
TypeName = ddt_val_by_row(table, table_Row, "TypeName");
ddt_set_row(table,table_Row);
set_window ("µ¥Î»×é", 1);
obj_mouse_click ("uo_new", 39, 40, LEFT);
obj_mouse_click ("uo_new", 39, 40, LEFT);
# ±à¼
set_window ("±à¼", 1);
edit_get_text("dw_1.code",text);
len = length(text);
if (len <= 0)
{
edit_set_insert_pos ("dw_1.code", 0, 0);
obj_type ("dw_1.code",TypeID);
}
tbl_set_selected_cell ("dw_1", "#1", "name");
obj_type ("dw_1.name",TypeName);
tbl_set_selected_cell ("dw_1", "#1", "shortcut");
# ÄÚ²ãÑ»·
tableUnit = "power_unit.xls";
rcUnit = ddt_open(tableUnit, DDT_MODE_READ);
if (rcUnit= E_OK && rcUnit != E_FILE_OPEN)
pause("Cannot open table.");
ddt_get_row_count(tableUnit,table_RowCountUnit);
end = UnitTypeNum[table_Row-1];
end += begin;
end -= 1;
for(begin; begin <= end; begin ++)
{
obj_mouse_click ("uo_new", 17, 30, LEFT);
obj_mouse_click ("uo_new", 17, 30, LEFT);
Unit = ddt_val_by_row(tableUnit, begin, "UnitName");
tbl_set_selected_cell ("dw_detail", "#"&begin, "IDAsInfo2");
tbl_set_cell_data ("dw_detail", "#"&begin, "IDAsInfo2", Unit);
} # ÄÚ²ã½áÊø
ddt_close(rcUnit);
# ±à¼
obj_mouse_click ("uo_save", 21, 28, LEFT);
obj_mouse_click ("uo_save", 21, 28, LEFT);
# ϵͳÌáʾ
set_window ("ϵͳÌáʾ", 2);
button_press ("È·¶¨");
win_close("±à¼");
} # Íâ²ã½áÊø
ddt_close(table);
set_window ("µ¥Î»×é", 1);
list_select_item ("tv_1", "µ¥Î»×é"); # Item Number 0;
obj_mouse_click ("uo_refresh", 8, 35, LEFT);
obj_mouse_click ("uo_refresh", 8, 35, LEFT);
obj_mouse_click ("uo_exit", 24, 32, LEFT);
obj_mouse_click ("uo_exit", 24, 32, LEFT);
这不叫测试,这叫输入数据. 刚学.
作者:
生如火花
时间:
2006-6-15 16:45
用合适的时间找到问题所在就是测试了,形式不重要
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2