TestComplete projects can include the TestedApps project item. This item holds a list of tested applications.
TestedApps object to access the list of tested applications from tests.
TestedApps object is a collection of
TestedApp objects corresponding to tested applications.
TestedApps object is available only if you have the TestedApps project item in your project.
The sample code below shows how to use the
TestedApp objects to add an application to the list of tested applications, modify its launch parameters, run the application, and then close it.
def TestProc(): # Obtains the 2nd app in # the list of tested applications app = TestedApps.Items # Changes the command line app.Params.SimpleParams.CommandLineParameters = "NotOpenApp" # Launches the application p = app.Run() # Tests the application #... # Closes the application app.Close() # Waits until the application closes Delay(2000) if p.Exists: # If the application still exists, terminates it app.Terminate()