Philip_Baird
11 years agoCommunity Expert
Determining the Test Complete Script Extension path
Hi, I have a requirement to provide an editable, unbundled configuration file with a Script Extension where:
1. The config file should Live in the same folder as the Script Extension
2. The path to the config file should be able to be dynamically evaluated by the Script Extension
To this end I have written the following function to obtain the Test Complete Script Extension path:
function getTestCompleteScriptExtensionPath() {
var scriptExtPath = "";
var scriptExtSubPath = "Extensions\\ScriptExtensions";
var proc = Sys.WaitProcess( "TestComplete" );
if( proc.Exists ) {
scriptExtPath = aqFileSystem.GetFileFolder( proc.Path );
scriptExtPath += ( scriptExtPath.charAt( scriptExtPath.length - 1 ) === "\\" )
? scriptExtSubPath
: "\\" + scriptExtSubPath;
}
return scriptExtPath;
}
This works, but I was wondering if this is the best or safest method to obtain this path?
Regards,
Phil Baird
1. The config file should Live in the same folder as the Script Extension
2. The path to the config file should be able to be dynamically evaluated by the Script Extension
To this end I have written the following function to obtain the Test Complete Script Extension path:
function getTestCompleteScriptExtensionPath() {
var scriptExtPath = "";
var scriptExtSubPath = "Extensions\\ScriptExtensions";
var proc = Sys.WaitProcess( "TestComplete" );
if( proc.Exists ) {
scriptExtPath = aqFileSystem.GetFileFolder( proc.Path );
scriptExtPath += ( scriptExtPath.charAt( scriptExtPath.length - 1 ) === "\\" )
? scriptExtSubPath
: "\\" + scriptExtSubPath;
}
return scriptExtPath;
}
This works, but I was wondering if this is the best or safest method to obtain this path?
Regards,
Phil Baird