Solved
Forum Discussion
HKosova
Alumni
9 years agoThe correct way is to check BuiltIn.ParamStr(0) - it returns the test runner path (TestComplete path or TestExecute path).
WaitProcess("TestComplete") can theoretically cause a false positive if both TestComplete and TestExecute are running at the same time (as of v.11.20 they cannot, but it might change in the future).
var testrunner_path = BuiltIn.ParamStr(0); // Example: "C:\Program Files\...\TestComplete.exe"
var testrunner = aqFileSystem.GetFileNameWithoutExtension(testrunner_path);
switch (testrunner)
{
case "TestComplete":
// ...
break;
case "TestExecute":
// ...
break;
default:
// This shouldn't happen
Log.Error("Unknown test runner: " + testrunner_path)
}
UPD: Here's another way that will work correctly:
var testrunner = Sys.FindId(Win32API.GetCurrentProcessId()).ProcessName; // "TestComplete" or "TestExecute"