Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How do I have Option set"s on different machines reference the same files for SilkTest?

How do I have Option set"s on different machines reference the same files for SilkTest?

There is a way of achieving this though not using variables as such. It involves the declaration of a series of constants which shall hold the relevant path data of the options set via the use of compiler constants.

  1. To activate the compiler constants dialog, go to SilkTest use Options | Runtime | Compiler Constants to create a Constant to store the relevant path.

    Compiler Constants Dialog:

    The Compiler Constants dialog is used to define constraints and assign various values to them. The defined constant may then be used anywhere you can declare an expression e.g. scripts & include files. The user specified constants are evaluated and replaced with their values at compile time.

    This dialog contains: "Constant Name" and "Value": this list box displays the list of defined constants and the values associated with them.

  2. In the "Constant Name" field, type the name you wish to give the constant. e.g. "FilePathWay"

  3. In the "Value" field, type the value you wish to associate with the constant name previously specified, in this case a path to files to be used. e.g. "c:\User\SilkTestFiles\FolderA"

  4. Once a constant name and value have been entered, click the Add button to add the new constant to the list.

Using the new constant:

The new constant can now be used within any test script or indeed the options set to specify a path way for files to be included. Shown below in an excerpt from an options set;

UseFiles = Sys_SetDir(FilePathWay)

Can be changed at runtime via:

The value of a compiler constant can be changed, e.g. the FilePathWay, via the Testplan by selecting a different option set or by setting the constant to a new value.

[ ] Test site1 (FilePathWay = "C:\User\SilkTestFiles\FolderA")
            optionset: optionset1.opt
            include: MyFilePathWay.pln
[ ] Test site2 (FilePathWay = "C:\User\SilkTestFiles\FolderB"
            optionset: optinonsset2.opt
            include: MyFilePathWay.pln

Old KB# 21211


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:17
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.