background image
<< Running Tests - Passing arguments to a script | Running Tests - Definition of results file >>
Running Tests - Results files
<< Running Tests - Passing arguments to a script | Running Tests - Definition of results file >>
148
User's Guide
6 R
UNNING
T
ESTS
AND
I
NTERPRETING
R
ESULTS
Results files
Examples The following testcase simply prints a list of all the passed
arguments:
testcase ProcessArgs ( )
LIST OF STRING lsArgs
lsArgs = GetArgs ( )
ListPrint (lsArgs)
You can also process the arguments individually. The following testcase
prints the second argument passed:
testcase ProcessSecondArg ( )
LIST OF STRING lsArgs
lsArgs = GetArgs ( )
Print (lsArgs[2])
The following testcase adds the first two arguments:
testcase AddArgs ()
LIST OF STRING lsArgs
lsArgs = GetArgs ( )
NUMBER nArgSum
nArgSum = Val (lsArgs[1]) + Val (lsArgs[2])
Print (nArgSum)
Note that the Val function was used to convert the arguments (which are
always passed as strings) into numbers. Specifying arguments
10 20 30
results in the following:
Script scr_args.t (10, 20, 30) - Passed
Passed:
1 test (100%)
Failed:
0 tests (0%)
Totals:
1 test, 0 errors, 0 warnings
Testcase AddArgs - Passed
30
Results files
When you run a testcase, script, suite, or testplan, SilkTest creates a results
file. The following figure shows a results file for a script (find.t). The menu
bar includes the Results menu, which allows you to manipulate the results file
and locate errors. The Results menu appears only when the active window
displays a results file