Adding Tested Applications

Applies to TestComplete 12.60, last modified on September 17, 2018

You can add applications to the Tested Applications collection of your project manually, or you can do this from tests, or TestComplete can do this for you during test recording. This topic describes different ways of adding applications to the Tested Applications list of your project.

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.

While creating a project

When you are adding a new project with the Create New Project Wizard at design time, TestComplete asks you to choose the application to be tested, specify the application’s parameters and then adds this application to the list of tested applications.

While creating 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.

From the TestedApps editor

  • 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.

  • 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 and web 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 scripting object:

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

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

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

-- or --

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

  • 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
About 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
Adding iOS Applications to the List of Tested Applications

Highlight search results