Params Property

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

A tested application can be run in Simple, RunAs, Debug or Profile run mode. You can specify the run mode in the TestedApps editor or from scripts. The Params property provides scripting access to properties specific to various run modes.

Declaration

TestedAppObj.Params

Read-Only Property The TestedAppParams object
TestedAppObj An expression, variable or parameter that specifies a reference to a TestedApp object

Applies To

The property is applied to the following object:

Property Value

The TestedAppParams object that provides access to various run-mode parameters.

Example

The following example demonstrates how to gain scripting access to the tested application’s parameters, modify them and launch the application.

JavaScript, JScript

function Test()
{

  var TestApp, Params, SimpleParams;
  TestApp = TestedApps.Items("SampleApp");
  // Obtains the tested application parameters
  Params = TestApp.Params;
  // Obtains the simple run mode parameters
  SimpleParams = Params.SimpleParams;

  // Modifies the simple run mode parameters:
  SimpleParams.CommandLineParameters = "NotOpenApp";
  SimpleParams.WorkFolder = "D:\\Work Folder";
  SimpleParams.Activate();
  // Launches the tested application
  TestApp.Run();

}

Python

def Test():
  TestApp = TestedApps.Items["SampleApp"]
  # Obtains the tested application parameters 
  Params = TestApp.Params
  # Obtains the simple run mode parameters 
  SimpleParams = Params.SimpleParams
  # Modifies the simple run mode parameters: 
  SimpleParams.CommandLineParameters = "NotOpenApp"
  SimpleParams.WorkFolder = "D:\\Work Folder"
  SimpleParams.Activate()
  # Launches the tested application 
  TestApp.Run()

VBScript

Sub Test

  Dim TestApp, Params, SimpleParams
  Set TestApp = TestedApps.Items("SampleApp")
  ' Obtains the tested application parameters
  Set Params = TestApp.Params
  ' Obtains the simple run mode parameters
  Set SimpleParams = Params.SimpleParams

  ' Modifies the simple run mode parameters:
  SimpleParams.CommandLineParameters = "NotOpenApp"
  SimpleParams.WorkFolder = "D:\Work Folder"
  SimpleParams.Activate
  ' Launches the tested application
  TestApp.Run

End Sub

DelphiScript

procedure Test();
var TestApp, Params, SimpleParams;
begin

  TestApp := TestedApps.Items('SampleApp');
  // Obtains the tested application parameters
  Params := TestApp.Params;
  // Obtains the simple run mode parameters
  SimpleParams := Params.SimpleParams;

  // Modifies the simple run mode parameters:
  SimpleParams.CommandLineParameters := 'NotOpenApp';
  SimpleParams.WorkFolder := 'D:\Work Folder';
  SimpleParams.Activate;
  // Launches the tested application
  TestApp.Run;

end;

C++Script, C#Script

function Test()
{

  var TestApp, Params, SimpleParams;
  TestApp = TestedApps["Items"]("SampleApp");
  // Obtains the tested application parameters
  Params = TestApp["Params"];
  // Obtains the simple run mode parameters
  SimpleParams = Params["SimpleParams"];

  // Modifies the simple run mode parameters:
  SimpleParams["CommandLineParameters"] = "NotOpenApp";
  SimpleParams["WorkFolder"] = "D:\\Work Folder";
  SimpleParams["Activate"]();
  // Launches the tested application
  TestApp["Run"]();

}

See Also

TestedAppParams Object
Editing Desktop Application Parameters
Run Modes and Parameters
About Tested Applications

Highlight search results