|
FRM v1.4.2 |
||||||||
PREV SCRIPT NEXT SCRIPT | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | FUNCT | DETAIL: FIELD | CONSTR | FUNCT |
CompiledModule | +--emos_frm_tbl_lib
This libary provides a family of functions for support of table GUI objects.
GUI objects in table format are known for being difficult to handle for
many reasons. First of all, although a single object a tables can
potentialy carry huge amounts of data. Depending on the testing objectives
we sometimes need to handle only a handfull of cells and in other cases big
portions of it if not the whole table. Programatic interfaces to tables are
usually handle individual table cells and the navigation through table.
More complicated actions on larger parts of table data are left to test
programmers to be designed from the basic table operations.
Secondly, tables are often very dynamic objects (i.e. their content and their
strucure sometimes changes within a single test session). A robust test design
should provide for easy location of data (e.g. dynamcally determining the
appropriate row/column) which is not a trivial task.
Finally, individual table cells can in fact contain various sorts of other
GUI objects such as edit fields, drop-down lists, combo boxes, radio buttons,
check buttons and other. Sometimes it seems as if vendors of GUI toolkits
simply had to invent something that would distinguish their tables from all
the other ones.
WinRunner's tbl interface does a fairly good job in making these various tables appear similar. However, there are plenty of situations where this is not the case. Here only individual solutions can help. Our table interface builds upon the strengths of WinRunner tbl-interface and is therefore able to handle many different tables. Still, due to mentioned difficulties, the interface is limited in some aspects and will need to be tuned for certain environments. Our code should work well with HTML tables and with tables with well-working tbl-interface (tbl_set_cell_data/tbl_get_cell_data). We hope also, that our code provides enough design ideas which will help you handle exotic cells such as edit fields, combo-boxes, etc.
Our table support has been specially designed for use in EMOS Framework tables. Pay special attention to functions FRM_TBL_set_data() and FRM_TBL_set_data_block(). The former implements an interface for handing individual table cells. The later implements an interface for handing bigger portions of tables.
Function Summary | |
String |
FRM_TBL_cell_action(in tbl,
in cmd,
in frm_mode,
in desc,
in list)
Performs the action on a table cell as specified by the command cmd .
|
String |
FRM_TBL_CHK_button(in tbl,
in row,
in col,
in obj,
in val,
in simple_select,
in exact)
|
String |
FRM_TBL_CHK_cell_action(in tbl,
in cmd,
in desc,
in list)
|
String |
FRM_TBL_CHK_data(in tbl,
in row,
in col,
in val,
in simple_select,
in operation)
|
String |
FRM_TBL_CHK_edit(in tbl,
in row,
in col,
in obj,
in val,
in simple_select,
in exact)
|
String |
FRM_TBL_CHK_pick(in tbl,
in row,
in col,
in obj,
in list,
in val,
in simple_select,
in exact)
|
String |
FRM_TBL_determine_col(in tbl,
in row,
in col,
in val,
out out_col,
in exact)
Returns the name/index of the column depending on the specified row/col. |
String |
FRM_TBL_determine_row(in tbl,
in row,
in col,
in val,
out out_row,
in exact)
Returns the name/index of the row depending on the specified row/col. |
String |
FRM_TBL_find_cell(in tbl,
in regex,
out out_row,
out out_col,
in row,
in col,
in exact,
in row_offset)
Searches for a cell that contains a given regex .
|
String |
FRM_TBL_find_row(in tbl,
in row_spec,
out out_row,
in idx,
in row_offset)
Searches for a row that contains given data in specified coumns. |
protected String |
FRM_TBL_generic_check(in actual,
in expected,
in operation)
|
String |
FRM_TBL_get_cols_count_adjustment()
Function tbl_get_cols_count() sometimes returns count that is less than the physical number of columns. |
String |
FRM_TBL_GET_data(in tbl,
in row,
in col,
out val,
in simple_select)
|
String |
FRM_TBL_get_rows_count_adjustment()
Function tbl_get_rows_count() sometimes returns count that is less than the physical number of rows. |
String |
FRM_TBL_list_select_item(in obj,
in list,
in item)
Pops a drop-down list on a Stingray-ComboBox-cell by performing a left-mouse click at some calculated position within the obj . |
String |
FRM_TBL_obj_drop_list(in obj)
Pops a drop-down list on Stingray-ComboBox-cell by performing a left-mouse click at some calculated position within the obj . |
String |
FRM_TBL_popup_cell_menu(in tbl,
in row,
in col)
Selects the cell and opens it's popup menue via the <kAppa> key. |
String |
FRM_TBL_popup_menu(in tbl,
in x,
in y)
Opens a popup menue at the specified location within the table object or, if not specified, at the top-left corner of the table object. |
protected String |
FRM_TBL_process_data_block(in tid,
in block,
in obj)
Process 2-dimensional table block |
String |
FRM_TBL_select(in tbl,
in row,
in col,
in simple_select)
|
String |
FRM_TBL_SET_button(in tbl,
in row,
in col,
in obj,
in val,
in simple_select)
|
String |
FRM_TBL_set_cols_count_adjustment(in amount)
Function tbl_get_cols_count() sometimes returns count that is less than the physical number of columns. |
String |
FRM_TBL_set_data_block(in tid1,
in test,
in obj)
Performs an action(s) on a block of table cells. |
String |
FRM_TBL_set_data(in table,
in test,
in obj,
in desc,
in list)
Performs operations on single table cells for the whole test block (i.e. |
String |
FRM_TBL_SET_data(in tbl,
in row,
in col,
in val,
in simple_select)
|
String |
FRM_TBL_SET_edit(in tbl,
in row,
in col,
in obj,
in val,
in simple_select)
|
String |
FRM_TBL_SET_pick(in tbl,
in row,
in col,
in obj,
in list,
in val,
in simple_select)
|
String |
FRM_TBL_set_rows_count_adjustment(in amount)
Function tbl_get_rows_count() sometimes returns count that is less than the physical number of rows. |
String |
FRM_TBL_type(in tbl,
in row,
in col,
in val,
in simple_select)
|
String |
FRM_TBL_web_get_child_item(in tbl,
in row,
in col,
in desc)
|
Function Detail |
public String FRM_TBL_set_data(in table, in test, in obj, in desc, in list)
table
- (in) table indextest
- (in) test nameobj
- (in) logical name or phisical description of the table objectdesc
- (in) [optional] physical description of an edit object that is
located in the particular table cell (attempt only if such object really
appears in the cell; we had to fight one tweeked VB table once with this;
hopefulla you'll never need it; see FRM_TBL_cell_aktion() for more)list
- (in) [optional] physical description of a list object that is
located in the particular table cell (attempt only if such object really
appears in the cell, see code of FRM_TBL_cell_aktion function)
public String FRM_TBL_set_data_block(in tid1, in test, in obj)
tid1
- (in) id of the table where the instructins come fromtest
- (in) name of the test to run (as named in column "Name")obj
- (in) table object where actions are to be performedprotected String FRM_TBL_process_data_block(in tid, in block, in obj)
public String FRM_TBL_set_rows_count_adjustment(in amount)
amount
- (in) amount to adjustpublic String FRM_TBL_get_rows_count_adjustment()
public String FRM_TBL_set_cols_count_adjustment(in amount)
amount
- (in) amount to adjustpublic String FRM_TBL_get_cols_count_adjustment()
public String FRM_TBL_cell_action(in tbl, in cmd, in frm_mode, in desc, in list)
cmd
.
There are four types of actions you can perform on a table cell:
All actions can be specified by a generic syntax:
~action~[row]~[col][~val[~obj[~exact]]]
where
#1
)col1=val1[;coln=valn]...
where col1 ist the name of the column containing val1, etc. the
separator ; (semicolon) is interpreted as logical AND<LAST>
in which case the last valid row spec is
reused (no search is performed for preformance reasons)Par1
) it is assumed that col #0 contains row
names [obsolete; replaced by #0=val
] #0=val
]#1
)Col1
)row1=val1[;rown=valn]...
where row1 ist the name of the row containing val1, etc. the
separator ; (semicolon) is interpreted as logical AND<LAST>
in which case the last valid column spec is
reused (no search is performed for preformance reasons)#0=val
]A few examples:
tbl
- (in) table namecmd
- (in) command to be performedfrm_mode
- (in) [optional] FRM mode (FRM_SET_MODE|FRM_CHK_MODE|FRM_ATR_MODE|FRM_GEN_MODE)desc
- (in) [optional] default physical description of the object to be acted upon
this description is used unless overridden by the cmd,
if you don't provide this argument, "{class:edit}" will be usedlist
- (in) [optional] a description or a logical name of the combo box
containing the obj.public String FRM_TBL_CHK_cell_action(in tbl, in cmd, in desc, in list)
public String FRM_TBL_select(in tbl, in row, in col, in simple_select)
public String FRM_TBL_GET_data(in tbl, in row, in col, out val, in simple_select)
public String FRM_TBL_SET_data(in tbl, in row, in col, in val, in simple_select)
public String FRM_TBL_CHK_data(in tbl, in row, in col, in val, in simple_select, in operation)
protected String FRM_TBL_generic_check(in actual, in expected, in operation)
public String FRM_TBL_SET_edit(in tbl, in row, in col, in obj, in val, in simple_select)
public String FRM_TBL_CHK_edit(in tbl, in row, in col, in obj, in val, in simple_select, in exact)
public String FRM_TBL_SET_button(in tbl, in row, in col, in obj, in val, in simple_select)
public String FRM_TBL_CHK_button(in tbl, in row, in col, in obj, in val, in simple_select, in exact)
public String FRM_TBL_SET_pick(in tbl, in row, in col, in obj, in list, in val, in simple_select)
public String FRM_TBL_CHK_pick(in tbl, in row, in col, in obj, in list, in val, in simple_select, in exact)
public String FRM_TBL_type(in tbl, in row, in col, in val, in simple_select)
public String FRM_TBL_determine_row(in tbl, in row, in col, in val, out out_row, in exact)
tbl
- (in) table objectrow
- (in) row to select (if row does not equal "", no search is
performed; if row equals "col
- (in) column where <val> is searched forval
- (in) value to search for in the given columnout_row
- (out) the name of the determined rowexact
- (in) [optinal] true indicates that an exact match is to be performed
public String FRM_TBL_determine_col(in tbl, in row, in col, in val, out out_col, in exact)
tbl
- (in) table objectrow
- (in) row to select (if row does not match "#[0-9][0-9]*", then
column #0 is searched for the value <row>col
- (in) column to select (if col does not equal "", no search is
performed; if row equals "val
- (in) value to search for in the determined rowout_col
- (out) the name of the determined columnexact
- (in) [optinal] true indicates that an exact match is to be performed
public String FRM_TBL_find_row(in tbl, in row_spec, out out_row, in idx, in row_offset)
col=val[;col=val]...
where col
is either
row_spec
- (in) formated cell content specification (see above)out_row
- (out) row index (only if retrn == E_OK)idx
- (in) [optional] internal index needed for recursion
public String FRM_TBL_find_cell(in tbl, in regex, out out_row, out out_col, in row, in col, in exact, in row_offset)
regex
.
You can limit the search to a particular row
or a col
,
by providing their names or indices (#idx).
tbl
- (in) table objectregex
- (in) text to search for (regular expression)out_row
- (out) row where text was foundout_col
- (out) column where text was foundrow
- (in) [optional] limit the search to this row onlycol
- (in) [optional] limit the search to this column onlyexact
- (in) [optional] TRUE=exact match, FALSE=tolerant match [default=FALSE]row_offset
- (in) [optional] row index where the search begins [default=0]
public String FRM_TBL_popup_cell_menu(in tbl, in row, in col)
tbl
- (in) table objectrow
- (in) row to selectcol
- (in) column to selectpublic String FRM_TBL_popup_menu(in tbl, in x, in y)
tbl
- (in) table objectx
- (in) [optional] x-coordinate to click to [default: 0]y
- (in) [optional] y-coordinate to click to [default: 0]public String FRM_TBL_list_select_item(in obj, in list, in item)
obj
.
obj
- (in) object to clicklist
- (in) list object that drops down after the clickitem
- (in) item to select
public String FRM_TBL_obj_drop_list(in obj)
obj
.
obj
- (in) object to click
public String FRM_TBL_web_get_child_item(in tbl, in row, in col, in desc)
|
FRM v1.4.2 |
||||||||
PREV SCRIPT NEXT SCRIPT | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | FUNCT | DETAIL: FIELD | CONSTR | FUNCT |