Adding Tested Applications

Applies to TestComplete 15.62, last modified on March 19, 2024

The Tested Applications collection stores the list of applications that the current TestComplete project will test with their launch parameters. You can add applications to the collection manually, or you can do it from tests. In addition, TestComplete can do it automatically during test recording.

The application path is a computer-specific setting. It may cause problems if you move your project to another machine or if you share the project with your co-workers. On other computers, the path may point to a non-existing location.

To make the path computer-independent, use the relative path to your tested application, if possible. If you share the project with several testers, place the application in a shared folder and use the network path to specify the application. This will help other testers avoid problems with the path. See also Avoiding Computer-Specific Settings.

After adding an application to the Tested Applications list, check the application’s path there and correct it, if needed.

When creating a project

When you are adding a new project with the Create New Project wizard at design time, you can choose the application to be tested: desktop or mobile.

When recording a test

When you start test recording with the Record Test wizard, TestComplete asks you to select the application for which you will record the test. TestComplete will add the application to the list of tested applications and start recording.

Manually in the Tested Apps editor

  1. If your project does not have the Tested Applications collection, add it:

    Add the Tested Apps collection to your project

    Click the image to enlarge it.

  2. Right-click somewhere within the Tested Apps editor and select  Add Application from the context menu.

    – or –

    Right-click the TestedApps node in the Project Explorer panel and select  New Item from the context menu.

  3. The Add Tested Application wizard will appear. Follow the wizard instructions to add the desired application to the project.

    To learn how to add various types of tested applications, see:

From the Object Browser (for desktop Windows applications only)

Right-click the application’s process (or any of its child objects) in the Object Browser’s Object Tree and select  Add Process to TestedApps from the context menu.

During test recording (for desktop applications)

When you launch a generic Windows application during test recording, TestComplete can automatically add that application to the Tested Applications collection of your project.

You can control this behavior by using the Automatically add applications to the Tested Applications list and Show 'Add <ApplicationName> to the list of tested applications?' message options.

From tests

You can add applications to the Tested Applications collection and define their properties directly from your tests. To do this, use the following methods of the TestedApps object.

You must have the Tested Applications collection in your TestComplete project to be able to call these methods.

Not applicable to mobile applications to run in the BitBar mobile device cloud. To learn how to run them from tests, see Connecting to Mobile Devices and Opening Testing Sessions.

Application Type Method
Desktop Windows application

Note: The Add method specifies the Simple run mode for the added application. To specify the RunAs, Profile or Debug mode for the added application, you can use the Params property of the TestedApps object.

TestedApps.Add
AIR application TestedApps.AddAIRApp
Java application TestedApps.AddJavaApp
Java Web Start application
(for example, an Oracle Forms application running out-of-browser)
TestedApps.AddJavaWebStartApp
Android application TestedApps.AddAndroidApp
iOS application TestedApps.AddiOSApp
ClickOnce application TestedApps.AddClickOnceApp
Windows Store application TestedApps.AddWinStoreApp

The following sample code demonstrates how you can use the TestedApps.Add method to add Notepad to the Tested Applications collection:

JavaScript, JScript

function AddTestedApp()
{

  // Add Notepad to Tested Applications
  var ind = TestedApps.Add("%WINDIR%\\notepad.exe");
  Log.Message( aqString.Format("Notepad was added to TestedApps under the name \"%s\" and index %d.",
               TestedApps.Items(ind).ItemName, ind) );

  // Launch Notepad
  TestedApps.Items(ind).Run();

}

Python

def AddTestedApp():
  
  # Add Notepad to Tested Applications
  ind = TestedApps.Add("%WINDIR%\\notepad.exe");
  Log.Message(aqString.Format('Notepad was added to TestedApps under the name "%s" and index %d.',\
              TestedApps.Items[ind].ItemName, ind) )

  # Launch Notepad
  TestedApps.Items[ind].Run()

VBScript

Sub AddTestedApp
  ' Add Notepad to Tested Applications
  ind = TestedApps.Add("%WINDIR%\notepad.exe")
  Call Log.Message( aqString.Format("Notepad was added to TestedApps under the name ""%s"" and index %d.", _
                    TestedApps.Items(ind).ItemName, ind) )

  ' Launch Notepad
  TestedApps.Items(ind).Run
End Sub

DelphiScript

procedure AddTestedApp;
var ind;
begin
  // Add Notepad to Tested Applications
  ind := TestedApps.Add('%WINDIR%\notepad.exe');
  Log.Message( aqString.Format('Notepad was added to TestedApps under the name "%s" and index %d.',
               TestedApps.Items[ind].ItemName, ind) );

  // Launch Notepad
  TestedApps.Items[ind].Run;
end;

C++Script, C#Script

function AddTestedApp()
{

  // Add Notepad to Tested Applications
  var ind = TestedApps["Add"]("%WINDIR%\\notepad.exe");
  Log["Message"]( aqString["Format"]("Notepad was added to TestedApps under the name \"%s\" and index %d.",
                  TestedApps["Items"](ind)["ItemName"], ind) );

  // Launch Notepad
  TestedApps["Items"](ind)["Run"]();
}

To define a tested application from keyword tests, call the described method by using the Call Object Method or Run Code Snippet operation.

By copying existing tested applications in the project

  1. Right-click the desired item in the Tested Apps editor and select Copy from its context menu.

  2. Right-click somewhere within the editor and select Paste from the context menu.

– or –

  1. Select the desired item in the Tested Apps editor and choose Edit > Copy from the TestComplete main menu.

  2. Select Edit > Paste from the main menu to paste the copied object to the editor.

After the new item appears in the tested application’s list, you can modify its properties, for example, the command-line parameters, the run mode and others.

See Also

About Tested Applications
TestedApps Editor
Defining Applications to Test
Adding Java and JavaFX Applications to the List of Tested Applications
Adding AIR Applications to the List of Tested Applications
Adding ClickOnce Applications to Tested Applications
Adding Android Applications to the List of Tested Applications (Legacy)
Adding iOS Applications to the List of Tested Applications (Legacy)

Highlight search results