AIRTestedApp Object

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The AIRTestedApp object corresponds to an AIR application in the project’s Tested Applications collection. It lets you get or set information about the application, such as the path to the AIR debug launcher and the application’s descriptor file or executable. It also provides methods used to launch and close the tested application from tests.

To obtain the AIRTestedApp object corresponding to a specific AIR tested application, use any of the following:

  • TestedApps.AIRAppName, where AIRAppName is the application’s name in the Tested Applications collection and in the Project Explorer.

  • TestedApps.Items(Index), where Index is the zero-based index of the application in the Tested Applications collection.

Members

Example

The example below demonstrates how to add an AIR application to the Tested Application collection, specify the application's launch parameters and run the application:

JavaScript, JScript

function Test()
{
  // Add an AIR application to the project
  var ind = TestedApps.AddAIRApp();
  var app = TestedApps.Items(ind);

  // Specify AIR application's launch parameters
  app.IsExecutable = false;
  app.DebuggerExecutable = "C:\\AIR\\bin\\adl.exe";
  app.DescriptorFileName = "C:\\AIRTestedApp\\Main.xml";

  // Launches the AIR application
  app.Run();
  // Test the application
  // ...

  app.Close();
}

Python

def Test():
  # Add an AIR application to the project
  ind = TestedApps.AddAIRApp;
  app = TestedApps.Items[ind];

  # Specify AIR application's launch parameters
  app.IsExecutable = False;
  app.DebuggerExecutable = "C:\\AIR\\bin\\adl.exe"
  app.DescriptorFileName = "C:\\AIRTestedApp\\Main.xml"

  # Launches the AIR application
  app.Run()
  # Test the application
  # ...

  app.Close()

VBScript

Sub Test
  ' Add an AIR application to the project
  ind = TestedApps.AddAIRApp
  Set app = TestedApps.Items(ind)

  ' Specify AIR application's launch parameters
  app.IsExecutable = False
  app.DebuggerExecutable = "C:\AIR\bin\adl.exe"
  app.DescriptorFileName = "C:\AIRTestedApp\Main.xml"

  ' Launches the AIR application
  app.Run
  ' Test the application
  ' ...

  app.Close
End Sub

DelphiScript

procedure Test();
var ind, app;
begin
  // Add an AIR application to the project
  ind := TestedApps.AddAIRApp;
  app := TestedApps.Items(ind);

  // Specify AIR application's launch parameters
  app.IsExecutable := false;
  app.DebuggerExecutable := 'C:\AIR\bin\adl.exe';
  app.DescriptorFileName := 'C:\AIRTestedApp\Main.xml';

  // Launches the AIR application
  app.Run;
  // Test the application
  // ...

  app.Close;
end;

C++Script, C#Script

function Test()
{
  // Add an AIR application to the project
  var ind = TestedApps["AddAIRApp"]();
  var app = TestedApps["Items"](ind);

  // Specify AIR application's launch parameters
  app["IsExecutable"] = false;
  app["DebuggerExecutable"] = "C:\\AIR\\bin\\adl.exe";
  app["DescriptorFileName"] = "C:\\AIRTestedApp\\Main.xml";

  // Launches the AIR application
  app["Run"]();
  // Test the application
  // ...

  app["Close"]();
}

See Also

Testing AIR Applications
About Tested Applications
Working With Tested Applications in Tests
TestedApps Object

Highlight search results