TestedAppSimpleParams Object

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

A tested application can be run in various modes. TestComplete includes a number of program objects that provide scripting access to parameters specific to this or that run mode. The TestedAppSimpleParams object contains properties specific to the Simple run mode.

To obtain the TestedAppSimpleParams object in your script, use the Params.SimpleParams sub-property of the corresponding TestedApp object. See Editing Desktop Application Parameters for details.

Members

Example

The following example demonstrates how to modify the tested application’s parameters in script:

JavaScript, JScript

function Test()
{

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

  // Modifies the parameters of the Simple run mode:
  // Specifies a command-line argument for the application
  SimpleParams.CommandLineParameters = "NotOpenApp";
  // Specifies a working folder for the tested application
  SimpleParams.WorkFolder = "D:\\Work Folder";
  // Applies the modified parameters and activates the Simple run mode
  SimpleParams.Activate();
  // Launches the tested application
  TestApp.Run();

}

Python

def Test():
  TestApp = TestedApps.Items["SampleApp"]
  # Obtains the tested application's parameters
  Params = TestApp.Params
  # Obtains the parameters of the Simple run mode
  SimpleParams = Params.SimpleParams
  # Modifies the parameters of the Simple run mode:
  # Specifies a command-line argument for the application
  SimpleParams.CommandLineParameters = "NotOpenApp"
  # Specifies a working folder for the tested application
  SimpleParams.WorkFolder = "D:\\Work Folder"
  # Applies the modified parameters and activates the Simple run mode
  SimpleParams.Activate()
  # Launches the tested application
  TestApp.Run()

VBScript

Sub Test

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

  ' Modifies the parameters of the Simple run mode:
  ' Specifies a command-line argument for the application
  SimpleParams.CommandLineParameters = "NotOpenApp"
  ' Specifies a working folder for the tested application
  SimpleParams.WorkFolder = "D:\Work Folder"
  ' Applies the modified parameters and activates the Simple run mode
  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's parameters
  Params := TestApp.Params;
  // Obtains the parameters of the Simple run mode
  SimpleParams := Params.SimpleParams;

  // Modifies the parameters of the Simple run mode:
  // Specifies a command-line argument for the application
  SimpleParams.CommandLineParameters := 'NotOpenApp';
  // Specifies a working folder for the tested application
  SimpleParams.WorkFolder := 'D:\Work Folder';
  // Applies the modified parameters and activates the Simple run mode
  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's parameters
  Params = TestApp["Params"];
  // Obtains the parameters of the Simple run mode
  SimpleParams = Params["SimpleParams"];

  // Modifies the parameters of the Simple run mode:
  // Specifies a command-line argument for the application
  SimpleParams["CommandLineParameters"] = "NotOpenApp";
  // Specifies a working folder for the tested application
  SimpleParams["WorkFolder"] = "D:\\Work Folder";
  // Applies the modified parameters and activates the Simple run mode
  SimpleParams["Activate"]();
  // Launches the tested application
  TestApp["Run"]();

}

See Also

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

Highlight search results