background image
<< Running Tests - Running a testplan | Running Tests - Results files >>
Running Tests - Passing arguments to a script
<< Running Tests - Running a testplan | Running Tests - Results files >>
User's Guide
147
6 R
UNNING
T
ESTS
AND
I
NTERPRETING
R
ESULTS
Running tests
Procedure To run marked tests, select Run/Run Marked Tests.
QA Organizer runs each marked test and generates a results file.
How subplans are handled If your testplan is structured as a master plan
and associated subplans, SilkTest automatically opens any closed subplans
before running. For more information on using subplans, see "Dividing a
testplan into a master plan and subplans" on page 257.
About saving files
SilkTest always saves the suite, script, or testplan before running it if you
made any changes to it since the last time you saved it.
By default, SilkTest also saves all other open modified files whenever you run
a script, suite, or testplan. To prevent this automatic saving of other open
modified files, deselect the Save Files Before Running check box in the
General Options dialog. See "Options/General..." on page 480.
Passing arguments to
a script
You can pass arguments to a script. For example, you might want to pass in
the number of iterations to perform or the name of a data file.
All functions and testcases in the script have access to the arguments.
Passing arguments There are three ways to pass arguments to a script:
·
You can specify them in the Arguments field in the Runtime Options
dialog (Options/Runtime from the menu bar).
Note The Arguments field in the Run Testcase dialog is used to pass
arguments to a testcase, not to an entire script.
·
You can specify them in a suite file after a script name, such as:
find.t
arg1 arg2
·
You can provide arguments when you invoke SilkTest from the command
line. See Chapter 26, "Command Line Syntax".
All arguments are passed in as strings, separated by spaces, such as:
Bob Emily Craig
If an argument is more than one word, enclose it with quotation marks. For
example, the following passes in three arguments:
"Bob H" "Emily M" "Craig J"
Processing arguments You use the GetArgs function to process arguments
passed into a script. GetArgs returns a list of strings, with each string being
one of the passed arguments. Any testcase or function in a script can call
GetArgs to access the arguments.