Run TestedApp Operation

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

The Run TestedApp operation is used to launch one or all applications that are included into the tested applications list of your TestComplete project.

Requirements

In order for you to be able to add the operation to a keyword test, the test project must contain the Tested Applications item.

Operation Result

If you launch all tested applications defined in your project, the operation does not return any value.

If you launch one tested application, the operation result depends on the run mode selected for the application in the TestedApps Editor:

  • If the run mode is Simple or RunAs, the operation returns the process object that corresponds the application instance.

  • If the run mode is Profile, the operation returns the AQtime object, which contains methods and properties relevant to the AQtime version that is specified by the application’s properties in the TestedApps editor.

If the launch fails, the operation returns an empty stub object. The Exists property of this object returns False.

For information on how to obtain the result value, see Checking Operation Result.

Scripting Analogue

The actions which the operation performs are similar to the Run method of the TestedApp object or to the RunAll method of the TestedApps object.

Child Operations

The operation cannot have child operations.

Operation Parameters

When you add the operation to your keyword test, TestComplete displays the wizard that contains two pages:

Specify Tested Application

On this page you specify the tested application which will be launched by the operation. The page contains the list of applications that are added to the tested applications list of your project. Select the application you need to launch and press Next to continue.

The list also contains the All Applications item. By selecting it, you specify that the operation must run all the applications.

Operation Parameters

On this page you can specify the parameters of the run. Note that the parameters are shown only if you chose an application in the Specify Tested Application page. If you chose the All Applications item, the page appears empty.

Note: These parameters are ignored for ClickOnce and Web tested applications.

Count

Integer. Specifies the number of application instances to be launched.

If Count is -1, the number of application instances launched by the operation corresponds to the number specified in the application’s Count property in the TestedApps Editor.

The number of launched instances depends on the IgnoreRunning parameter. If this parameter is True, the operation launches as many instances as it is specified by the Count parameter. If IgnoreRunning is False, Count specifies the total number of instances that should exist and the operation launches only the lacking instances. For instance, if IgnoreRunning is False, Count is 5 and there are two applications instances running in the system, the operation will launch 3 instances (5 - 2 = 3), but not 5.

IgnoreRunning

Boolean. Specifies whether the operation should count the running instance of the tested application when launching new instances.

Timeout

Integer. Specifies the number of milliseconds which the operation will wait until all the application instances have created. If the Timeout is -1, the waiting time is infinite. If the timeout occurs, the operation considers the launch as failed.

Remarks

  • The Run TestedApp operation depends on the properties of the tested applications that are specified in the TestedApps Editor.

  • If the Launch application from tests setting is disabled for the application in the TestedApps Editor, the application will not be launched.

  • To launch web browsers, it is recommended that you use the Run Browser operation.

  • Sometimes the Run TestedApp operation may hang the application. The fact is that to obtain the application’s process, the operation uses the WaitForInputIdle function of Windows API. When this function hangs, the operation hangs as well. To avoid this behavior, use the following workaround: create a batch file (.bat) that will call your application and add this file to the list of tested applications instead of the application.

  • Running a tested application in RunAs mode requires that the Secondary Logon service be running in Windows.

  • To launch a tested application in Profile or RunAs mode, TestComplete must be running with administrator permissions. See Using TestComplete With Administrator Privileges.

  • When launching an application with administrator privileges, the operating system displays a dialog box asking for your permission to run it. Due to certain limitations, the closing of this dialog box cannot be automated. You should close it manually, or modify User Account Control settings so that Windows does not display the dialog. See Using TestComplete With Administrator Privileges.

See Also

Test Actions Category
Specifying Operation Parameters
Checking Operation Result
Run Code Snippet Operation
Call Object Method Operation
About Tested Applications
Running Tested Applications
Run Browser Operation

Highlight search results