Environment variable in persistent variables declaration
I want to use a Windows environment variable in the persistent variables section of a keyword test.
E.g. Something line InstallFolder is %TEMP%\MyAppLocation.
Using the variable InstallFolder works fine when defining the tested apps. E.g MyApp is $(InstallFolder)\MyApp.exe. The application starts as expected.
But when adding a check in JavaScript to verify if the InstallFolder folder exists, the check fails because the variable %TEMP% is not expanded.
E.g. aqFileSystem.Exists(Project.Variables.InstallFolder) returns false because Project.Variables.InstallFolder returns the string %TEMP%\MyAppLocation and not <Where ever my temp folder is>\MyAppLocation.
How can I fix this?
I'm new to TestComplete. So if my question may be a little bit unprecise. Hope it is not too confusing ...
TestComplete 14.40
Windows 10
Scripting language JavaScript
You have some environment variables directly avaiable with Sys.OSInfo object.
For example, to get the specific value of %TEMP% you must use Sys.OSInfo.TempDirectory
For other environment variables:
For general use for environment variables:
https://support.smartbear.com/testcomplete/docs/testing-with/advanced/environment-variables.html