Causes a specified file or files to be included in the compilation of a test case as though the contents of the file(s) were part of the test case file. The use statement is functionally equivalent to a C include statement. It takes a string parameter which can be supplied in several ways, as shown below.
use "FileName" or use sVar or use UseConstant
Variable | Description |
---|---|
FileName | A file name or path name string. STRING. |
sVar | A string constant that has been declared and set in a file that is included in this file prior to this use statement. STRING. |
UseConstant | A compiler constant that you have defined and set with the Silk Test Classic Compiler Constants window. The compiler constant value must resolve to a string. |
Window declarations and helper functions can be placed in a separate include file. This allows code that is used in many test cases to be placed in one file and then reused multiple times. A compiler constant allows you to customize a test case before using it. For example, a test case can be written that depends on the value of a constant that specifies the language to use. Before running the test you set the compiler constant to specify the language for this test run.
When you call a use statement against a file, you can reference all variables and constants within that file without calling additional use statements.
// ccmail.t use "ccmail.inc" use sSmallSet // This constant is defined in ccmail.inc use LangConst // Set this constant before running test