Different application filepaths for TestedApps
Prior to recording keyword tests/scripts on a system, one must identify the application(s) being tested in the TestedApps area and then, in the script, start an application with the TestApps.<appname>.Run (or RunAs) method. In the TestedApps area of TestComplete, the source/filepath of the executable is identified in the "Application:" textbox. All is well and good until I try to run the project on a different system where the TestedApp application/executable has been installed in a totally different filepath.
Now, I can certainly create multiple copies of the application in the TestedApps area (with different names such as MyApp1, MyApp2, etc) and then insert IF logic in the test/script that will find the app in the correct location:
If Sys.HostName = "ServerA" Then
Call TestedApps.MyApp1.Run(1, True)
ElseIf Sys.HostName = "ServerB" Then
Call TestedApps.MyApp2.Run(1, True)
Else
Call TestedApps.MyApp3.Run(1, True)
End If
but that seems like a bulky, convoluted way to handle it. What I envision would be having an optional configuration file associated with the project suite that can be edited on a particular system with that system's correct values which are read in at project suite start up and utilized for the run. Something like:
<TestExecuteConfig>
<TestedApps>
<MyApp>
<FilePath>C:\ProgramFiles\MyApp.exe</FilePath>
<CommandLineParms></CommandLineParms>
<WorkingFolder></WorkingFolder>
<MyApp/>
<AnotherApp>
<FilePath>C:\ProgramFiles\AnotherApp.exe</FilePath>
<CommandLineParms></CommandLineParms>
<WorkingFolder></WorkingFolder>
</AnotherApp>
</TestedApps>
<SomethingElse>
. . . . . . . . . . . . . . . .
</SomethingElse>
</TestExecuteConfig>
The "Application:" textbox would dynamically be populated with the FilePath value above requiring only one definition of the application in the TestApps area and no IF logic necessary.
Does anything like this exist in TestComplete/TestExecute and, if not, what is the best way to handle it? I searched the Help files within the TestComplete application and this Community Board but didn't really see anything close to this.