Interview Questions

Need to use the relative paths in my SilkTest Project. How to change the absolute paths to relative paths.

SilkTest Questions and Anwsers


(Continued from previous question...)

119.Need to use the relative paths in my SilkTest Project. How to change the absolute paths to relative paths.

Need to use the relative paths in my SilkTest Project. How to change the absolute paths to relative paths. The purpose is that, when package the project, that package can be used on any other machine, irrespective of the paths defined, it should run on that machine too.


Answer1:
Say you have following organization of files
C:\Test\Script\Script.t
C:\Test\WDec\WDec.inc
Now in Scrpt.t file to include WDec.inc, code following
1. use " C:\Test\WDec\WDec.inc" --> Absolute
OR
2. use "..\WDec\WDec.inc" --> Relative [Move one level up from Script folder, then go to WDec folder]

Answer2:
I think if you work with Silk Project, it offers you some out of the box solution for this. If your suite is not implemented as a project, the best option is to use relative path in the Runtime options dialogbox, with the Root of the suite hardcoded.
i.e. Use Path = S:\Suite << S maps to root of the automation suite
and use files are relative .i.e. frame.inc, ..\config\config.inc etc etc,

(Continued on next question...)

Other Interview Questions