Name Property

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

Description

To modify tested application parameters, TestComplete offers special program objects. These objects are collections that contain parameters specific for application type and run mode. The Name property specifies the application’s run mode or type that corresponds to the given parameter collection.

Declaration

ProgObj.Name

Read-Only Property String
ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

Property Value

It returns one of the following string values that specify the run mode or the application type corresponding to the given parameter collection:

  • Simple
  • Debug
  • RunAs
  • Profile
  • AIR
  • Java
  • Web
  • ClickOnce

Example

The following example determines which run mode of the specified tested application is currently active, posts the name of the active run mode to the test log and then launches the tested application.

JavaScript, JScript

function Test()
{
  var TestApp = TestedApps.Items("SampleApp");
  // Obtains the tested application's parameters
  var Params = TestApp.Params;

  // Obtains the name of the active collection of parameters
  var Name = Params.ActiveParams.Name;
  // Posts the name of the run mode to the test log
  Log.Message("The application will be run in the " + Name + " run mode.");

  // Launches the tested application
  TestApp.Run();
}

Python

def Test():
  TestApp = TestedApps.Items["SampleApp"]
  # Obtains the tested application's parameters 
  Params = TestApp.Params
  # Obtains the name of the active collection of parameters 
  Name = Params.ActiveParams.Name
  # Posts the name of the run mode to the test log 
  Log.Message("The application will be run in the " + Name + " run mode.")
  # Launches the tested application 
  TestApp.Run()

VBScript

Sub Test
  Dim TestApp, Params, Name
  Set TestApp = TestedApps.Items("SampleApp")
  ' Obtains the tested application's parameters
  Set Params = TestApp.Params

  ' Obtains the name of the active collection of parameters
  Name = Params.ActiveParams.Name
  ' Posts the name of the run mode to the test log
  Log.Message "The application will be run in the " & Name & " run mode."

  ' Launches the tested application
  TestApp.Run
End Sub

DelphiScript

procedure Test();
var TestApp, Params, Name;
begin
  TestApp := TestedApps.Items('SampleApp');
  // Obtains the tested application's parameters
  Params := TestApp.Params;

  // Obtains the name of the active collection of parameters
  Name := Params.ActiveParams.Name;
  // Posts the name of the run mode to the test log
  Log.Message('The application will be run in the ' + Name + ' run mode.');

  // Launches the tested application
  TestApp.Run;
end;

C++Script, C#Script

function Test()
{
  var TestApp = TestedApps["Items"]("SampleApp");
  // Obtains the tested application's parameters
  var Params = TestApp["Params"];

  // Obtains the name of the active collection of parameters
  var Name = Params["ActiveParams"]["Name"];
  // Posts the name of the run mode to the test log
  Log.Message("The application will be run in the " + Name + " run mode.");

  // Launches the tested application
  TestApp["Run"]();
}

See Also

Run Modes and Parameters
Activate Method
IsActive Method
TestedAppSimpleParams Object
TestedAppRunAsParams Object
TestedAppDebugParams Object
TestedAppProfileParams Object
About Tested Applications

Highlight search results