FRM
v1.4.2

frm
Script emos_frm_driver_lib

CompiledModule
  |
  +--emos_frm_driver_lib

The library routines for the EMOS_FRM_driver test.

Tsl
emos_frm_driver_lib.tsl

Function Summary
protected  String FRM_DRV_ask(in tid, in param, in msg, out val, in flag)
          Waits for the user input (an edit field and OK/Cancel buttons) if a table cell contains a specielly formatted data.
protected  String FRM_DRV_choose_table(in dir, in name, in ask, out path)
          Picks the appropriate file.
 String FRM_DRV_execute_set_array(inout[] callArr)
          Executes several test sets as defined by the parameter callArr[].
 String FRM_DRV_handle_processed_block(in block, in test, in rc, inout frm_rc)
          Formats the report for procesed test blocks.
 String FRM_DRV_handle_unimplemented_block(in block, inout frm_rc)
          Formats the report for unimplemented test blocks.
 String FRM_DRV_handle_unknown_block(in block, inout frm_rc)
          Formats the report for unknown test blocks.
 String FRM_DRV_is_fail_on_unknown_test()
          Get routine for activating activating failure on unknown test
 String FRM_DRV_is_new_test_driver()
          Get routine for activating the new test driver logic
 String FRM_DRV_main(in arg1, in arg2, in arg3, in arg4, in arg5)
          The main loop processes all rows in the suite table.
 String FRM_DRV_set_ask(in par)
          TRUE: gives you the option to choose the alternative suite table; FALSE: opens the defined table only [default]
 String FRM_DRV_set_columns(in cols)
          Comma-separated string defining the titles of the four important columns [default: "Bearbeiten?
 String FRM_DRV_set_data_home(in dir)
          Home directory for test data
 String FRM_DRV_set_default_error_mode(in mode, in mode_list)
          Sets the default error mode.
 String FRM_DRV_set_default_suite_table(in name)
          Name of the test suite table
 String FRM_DRV_set_fail_on_unknown_test(in mode)
          Turns failure on unknown test on/off [default: FALSE]
 String FRM_DRV_set_new_test_driver(in test_driver)
          Set routine for activating the new test driver logic
 String FRM_DRV_set_script_home(in dir)
          Home directory for test scripts
 String FRM_DRV_test_driver(in lib, in tid, in test)
          The main lop for driving the test navigation.
 String FRM_DRV_test_set_driver(in script, in table, in testset, in comment)
          Executes a set of tests from a specified data table by the specified script.
protected  String FRM_DRV_test_suite_driver(in script_home, in data_home, in stid, inout[] cols, in rows)
          execute a test suite excel table.
protected  String load_drv_lib(in lib, in p1, in p2)
          Loads driver libs.
 

Function Detail

FRM_DRV_set_script_home

public String FRM_DRV_set_script_home(in dir)
Home directory for test scripts


FRM_DRV_set_data_home

public String FRM_DRV_set_data_home(in dir)
Home directory for test data


FRM_DRV_set_default_suite_table

public String FRM_DRV_set_default_suite_table(in name)
Name of the test suite table


FRM_DRV_set_new_test_driver

public String FRM_DRV_set_new_test_driver(in test_driver)
Set routine for activating the new test driver logic


FRM_DRV_is_new_test_driver

public String FRM_DRV_is_new_test_driver()
Get routine for activating the new test driver logic


FRM_DRV_set_fail_on_unknown_test

public String FRM_DRV_set_fail_on_unknown_test(in mode)
Turns failure on unknown test on/off [default: FALSE]

Parameters:
mode - (in) TRUE raises an error by FRM_DRV_test_set_driver() if an unknown test (i.e. nonexisting column) is called, FALSE doesn't

FRM_DRV_is_fail_on_unknown_test

public String FRM_DRV_is_fail_on_unknown_test()
Get routine for activating activating failure on unknown test


FRM_DRV_set_default_error_mode

public String FRM_DRV_set_default_error_mode(in mode,
                                             in mode_list)
Sets the default error mode. This value is evaluated by the emos driver in in order to determine how to proceed after an error has been detected in some test block. In interactive mode a dialog is displayed where you can interactively choose the desired behaviour. In batchmode or if you choose "Cancel" in interactive mode the default mode which is set here is applied. By default the E_FRM_CONTINUE is used (which means that no test block will be skipped due to errors).

Parameters:
mode - (in) possible values E_FRM_TEST_STOP, E_FRM_SET_STOP, E_FRM_SUITE_STOP, E_FRM_CONTINUE if eny other value was passed (including E_FRM_RETRY) the default mode will be set to E_FRM_CONTINUE.
Returns:
the mode actually set (note it may be different from the wanted one!)

FRM_DRV_set_ask

public String FRM_DRV_set_ask(in par)
TRUE: gives you the option to choose the alternative suite table; FALSE: opens the defined table only [default]


FRM_DRV_set_columns

public String FRM_DRV_set_columns(in cols)
Comma-separated string defining the titles of the four important columns [default:
"Bearbeiten?,Testscript,Testtabelle,Testset[,Kommentar]"
]


FRM_DRV_main

public String FRM_DRV_main(in arg1,
                           in arg2,
                           in arg3,
                           in arg4,
                           in arg5)
The main loop processes all rows in the suite table.

Parameters:
arg1 - home directory for test scripts
arg2 - home directory for test data
arg3 - name of the test suite table
arg4 - TRUE: gives you the option to choose alternative suite table; FALSE: opens the defined table only [default]
arg5 - comma-separated string defining the titles of the four important columns [default:
"Bearbeiten?,Testscript,Testtabelle,Testset[,Kommentar]"
]
Returns:
E_OK: success !E_OK: failure

FRM_DRV_choose_table

protected String FRM_DRV_choose_table(in dir,
                                      in name,
                                      in ask,
                                      out path)
Picks the appropriate file. If <ask> = TRUE [defult], then a file browse dialog is shown to interactively pick the file. In batch mode, the dialog is not shown.

Parameters:
dir - (in) directory
name - (in) file name
ask - (in) (optional) TRUE/FALSE [default: TRUE]
path - (out) full path name to be used
Returns:
E_OK: success !E_OK: failure

FRM_DRV_ask

protected String FRM_DRV_ask(in tid,
                             in param,
                             in msg,
                             out val,
                             in flag)
Waits for the user input (an edit field and OK/Cancel buttons) if a table cell contains a specielly formatted data. The data is "specially formatted" if it either begins with the question mark or with some other string as defined by flag parameter.

Parameters:
tid - (in) table ID
param - (in) column name
msg - (in) message to be displayed
val - (out) value choosen (empty string indicates Cancel)
flag - (in) (optional) prefix which indicates the "askable" data [default: ?]
Returns:
E_OK: success; val contains valid data !E_OK: failure; do not rely on val

FRM_DRV_test_suite_driver

protected String FRM_DRV_test_suite_driver(in script_home,
                                           in data_home,
                                           in stid,
                                           inout[] cols,
                                           in rows)
execute a test suite excel table.

Parameters:
script_home - home directory for test scripts
data_home - home directory for test data
stid - suite_table ID ( as returned by FRM_open() )
cols -
rows -

FRM_DRV_test_set_driver

public String FRM_DRV_test_set_driver(in script,
                                      in table,
                                      in testset,
                                      in comment)
Executes a set of tests from a specified data table by the specified script.

Parameters:
script - (in) test driver (full path or accessable vie search path)
table - (in) data table (full path name!)
testset - (in) names of the tests to be executed (individual entries are comma-separated; numeric ranges can be shortend by hyphen, e.g. 1-5 which stands for 1,2,3,4,5; ranges can also be defined within name spaces and are similarly shortened, e.g. a1-3 stands for a1,a2,a3)

FRM_DRV_test_driver

public String FRM_DRV_test_driver(in lib,
                                  in tid,
                                  in test)
The main lop for driving the test navigation.

Parameters:
lib - (in) library that contains application-specific test navigation functions
tid - (in) table ID of the Excel table that contains the sepcified test
test - (in) name of the test (i.e. column) that is to be processed
Returns:
E_OK if successfull, else failure

FRM_DRV_handle_unimplemented_block

public String FRM_DRV_handle_unimplemented_block(in block,
                                                 inout frm_rc)
Formats the report for unimplemented test blocks. Note that this function increases the inout variable frm_rc by 1.

Parameters:
block - (in) the name of the test block
frm_rc - (inout) the status variable (increased by 1 upon the exit)

FRM_DRV_handle_unknown_block

public String FRM_DRV_handle_unknown_block(in block,
                                           inout frm_rc)
Formats the report for unknown test blocks. Note that this function increases the inout variable frm_rc by 1.

Parameters:
block - (in) the name of the test block
frm_rc - (inout) the status variable (increased by 1 upon the exit)

FRM_DRV_handle_processed_block

public String FRM_DRV_handle_processed_block(in block,
                                             in test,
                                             in rc,
                                             inout frm_rc)
Formats the report for procesed test blocks. Note that this function increases the inout variable frm_rc by 1 in case of rc!=0.

Parameters:
block - (in) the name of the test block
test - (in) the name of the test case
rc - (in) status returned by the processed test block
frm_rc - (in) the current value of the status variable
Returns:
0 to continue with the test case, 1 to stop the execution of the test case

load_drv_lib

protected String load_drv_lib(in lib,
                              in p1,
                              in p2)
Loads driver libs.

NOTE1
Each invocation of LINK|LINA|LINX instruction will cause a new "reload" of the specified driver library. This is necessary in order to ensure proper loading when multiple divers are used (big projects tend to use this strategy). If you want to skeep such unecessary reloading, you may remove the name of the driver from the LINK commands wherever you are sure that the proper driver has already been loaded, for example

		LINK~drv/xxx~~1_1
		LINK~~~1_2
		LINK~~~1_3
	

NOTE2
For compatibility reasons with older projects you should name your new driver libraries using the "_lib" suffix. If you preserve the rest of the driver name (e.g. if "DRV/xxx" is changed to "DRV/xxx_lib", then you need not modify anything in your Excel tables because this routine will automatically append "_lib" to all names that do not use this suffix.


FRM_DRV_execute_set_array

public String FRM_DRV_execute_set_array(inout[] callArr)
Executes several test sets as defined by the parameter callArr[].

NOTE1
Input array must be a two-dimensional array. First dimension must be sequentially indexed from 0 onwards. The second dimension must be sequentially numbered from 0 onwards where 0 holds "test driver name", 1 hodls "test table name", and 2 holds "test set name". The easiest way to initialise such array in the callong script is via the following construct:

		static callArr[] = {
			 { "drv/main", "table1.xls", "1-5" }
			,{ "drv/main", "table2.xls", "1-3" }
			,{ "drv/xxxx", "table2.xls", "3-9" }
		};
	

Parameters:
callArr - (inout) array contianing test set instructions (see above)
Returns:
E_OK if success else error

FRM
v1.4.2