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.
- 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.
- In the "Constant Name" field, type the name you wish to give the constant. e.g. "FilePathWay"
- 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"
- 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;
TraceAgentTags=FALSE TraceAgentCalls=FALSE ResultsHistorySize=25 ResultsPath= ObjfilePath= UsePath= UseFiles = Sys_SetDir(FilePathWay) Arguments= AgentName=(local)
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