TestedAppParams.ActiveParams

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Use the ActiveParams property to obtain access to the parameters currently applied to the tested application.

Declaration

TestedAppParamsObj.ActiveParams

Read-Only Property One of the objects listed in the Property Value section
TestedAppParamsObj An expression, variable or parameter that specifies a reference to a TestedAppParams object

Applies To

The property is applied to the following object:

Property Value

Depending on the application type and run mode, the property returns one of the following objects:

Remarks

When browsing the ActiveParams property in the Code Completion window, you may notice that the ActiveParams node only contains methods and properties that are common for all run-mode parameter objects (Name, Activate and others). This happens because the node does not display properties of the selected parameters collection. It displays only common methods and properties.

Example

The following example determines which run mode of the specified tested application is currently active, posts the name of the active 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 run mode name 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 run mode name 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 run mode name to the test log
  Call 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 run mode name 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 run mode name to the test log
  Log.Message("The application will be run in the " + Name + " run mode.");

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

}

See Also

About Tested Applications
Run Modes and Parameters
Editing Desktop Application Parameters
TestedAppParams.DebugParams
TestedAppParams.ProfileParams
TestedAppParams.RunAsParams
TestedAppParams.SimpleParams
TestedAppParams.JavaParams
TestedAppParams.AIRParams
TestedAppParams.WebParams
TestedAppParams.ClickOnceParams

Highlight search results