Automated tests can be classified into one of the following types:
Testing not only involves entering transaction codes and choosing actions from menus. It also involves entering data, such as the FIRM code, the ORDER_QUANTITY and so on. Automated testing is no different. For every Action Code, there is usually one or more data items required. For example, for a MARKET_QUOTE action code, the automated testing system expects that the tester will provide the BID price and the ASK price. These input data items are also called “parameters”. That is why the headings in the data tables are generalized, e.g. P1, P2, etc.
All Action codes and data are entered into an EXCEL table. The top row of the spreadsheet contains the column headings, which are the same for every spreadsheet and every test. The data table will usually contain more than one test case. A single test case may require just one row in the data table, but often requires several for a complex sequence of actions. A sample table is shown in Appendix 1.
An Excel macro can be built to display popup messages that explain every data value required for each different action code. Every time a new action code is added, the macro should be updated.
One approach that works well is to create tests that consist mostly of user-defined functions. One main function (I call it the DO_ALL function) reads the data table and interpret the actions and the data in the data table, calling other functions as required. It consists mostly of a large “case” statement (the “switch” function in WinRunner) that evaluates the data in the ACTION column of the data table and launches other user-defined functions as appropriate. The only “main” script in a test is the small “launching” test that passes the name of the data table to DO_ALL.
|
Sample
Data Table
|
||||||
|
TEST_GROUP |
TEST_CASE |
ACTION |
P1 |
P2 |
P3 |
P4 |
|
Quick Open Display |
13 |
FIND_PAGE |
-
|
R! |
-
|
-
|
|
LOCK_VOID |
-
|
-
|
R |
L |
||
|
CHECK_QOP |
-
|
-
|
N |
-
|
||
|
ENTER_QUOTE |
-
|
-
|
0 |
1+ |
||
|
CHECK_QOP |
-
|
-
|
Y |
-
|
||
|
Quick Open Display |
15 |
FIND_PAGE |
-
|
R! |
-
|
-
|
|
ENTER_ORDER |
-
|
-
|
-
|
M |
||
|
LOCK_VOID |
-
|
-
|
R |
L |
||
|
ENTER_QUOTE |
-
|
-
|
0 |
1+ |
||
|
CHECK_QOP |
-
|
-
|
Y |
-
|
||
©2002, Harvey Orom