TestedAppParams.ProfileParams

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

A tested application can be run in various modes. Use the ProfileParams property to obtain access to the parameters specific to the Profile run mode. The TestComplete engine will use these parameters to launch a tested application, if Profile run mode is chosen for this application.

Declaration

TestedAppParamsObj.ProfileParams

Read-Only Property The TestedAppProfileParams object
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

The TestedAppProfileParams object that provides a scripting interface to the parameters of the Profile run mode.

Example

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

JavaScript, JScript

function Test()
{

  var testApp = TestedApps.Items("SampleApp");

  // Obtain the tested application's parameters
  var params = testApp.Params;
  // Obtain the Profile run mode's parameters
  var profileParams = params.ProfileParams;

  // Specify the AQtime version
  profileParams.AQtimeVersion = 8;

  // Specify that TestComplete will use an AQtime project to profile the tested application
  profileParams.UseProject = true;
  // Specify the path to the AQtime project that TestComplete will use
  profileParams.ProjectFileName = "D:\\Work Folder\\Sample.aqt";

  // Specify that TestComplete sets the AQtime run mode after profiling starts
  profileParams.ForceRunMode = true;
  // Specify the AQtime run mode during profiling
  profileParams.RunMode = "Normal";

  // Specify that TestComplete uses the profiler specified in the TestComplete project
  profileParams.OverrideProfiler = true;

  // Specify the name of the AQtime profiler that will be used to profile the application
  profileParams.ProfilerName = "Performance Profiler";

  // Apply the modified parameters and activate the Profile run mode
  profileParams.Activate();

  // Launch the tested application
  var AQtimeObj = testApp.Run();

  // Simulate user actions against the tested application
  // …

  // Wait until profiling is over and export the profiling results
  AQtimeObj.WaitAndExportResults("D:\\Work Folder\\SummaryResultsFile.xml", "D:\\Work Folder\\ResultsFile.xml");

}

Python

def Test():
  testApp = TestedApps.Items["SampleApp"]
  # Obtain the tested application's parameters 
  params = testApp.Params
  # Obtain the Profile run mode's parameters 
  profileParams = params.ProfileParams
  # Specify the AQtime version 
  profileParams.AQtimeVersion = 8
  # Specify that TestComplete will use an AQtime project to profile the tested application 
  profileParams.UseProject = True
  # Specify the path to the AQtime project that TestComplete will use 
  profileParams.ProjectFileName = "D:\\Work Folder\\Sample.aqt"
  # Specify that TestComplete sets the AQtime run mode after profiling starts 
  profileParams.ForceRunMode = True
  # Specify the AQtime run mode during profiling 
  profileParams.RunMode = "Normal"
  # Specify that TestComplete uses the profiler specified in the TestComplete project 
  profileParams.OverrideProfiler = True
  # Specify the name of the AQtime profiler that will be used to profile the application 
  profileParams.ProfilerName = "Performance Profiler"
  # Apply the modified parameters and activate the Profile run mode 
  profileParams.Activate()
  # Launch the tested application 
  AQtimeObj = testApp.Run()
  # Simulate user actions against the tested application 
  # ... 
  # Wait until profiling is over and export the profiling results 
  AQtimeObj.WaitAndExportResults("D:\\Work Folder\\SummaryResultsFile.xml", "D:\\Work Folder\\ResultsFile.xml")

VBScript

Sub Test

  Set testApp = TestedApps.Items("SampleApp")

  ' Obtain the tested application's parameters
  Set params = testApp.Params
  ' Obtain the Profile run mode's parameters
  Set profileParams = params.ProfileParams

  ' Specify the AQtime version
  profileParams.AQtimeVersion = 8

  ' Specify that TestComplete will use an AQtime project to profile the tested application
  profileParams.UseProject = True
  ' Specify the path to the AQtime project that TestComplete will use
  profileParams.ProjectFileName = "D:\Work Folder\Sample.aqt"

  ' Specify that TestComplete sets the AQtime run mode after profiling starts
  profileParams.ForceRunMode = True
  ' Specify the AQtime run mode during profiling
  profileParams.RunMode = "Normal"

  ' Specify that TestComplete uses the profiler specified in the TestComplete project
  profileParams.OverrideProfiler = True

  ' Specify the name of the AQtime profiler that will be used to profile the application
  profileParams.ProfilerName = "Performance Profiler"

  ' Apply the modified parameters and activate the Profile run mode
  profileParams.Activate

  ' Launch the tested application
  Set AQtimeObj = testApp.Run

  ' Simulate user actions against the tested application
  ' …

  ' Wait until profiling is over and export the profiling results
  Call AQtimeObj.WaitAndExportResults("D:\Work Folder\SummaryResultsFile.xml", "D:\Work Folder\ResultsFile.xml")

End Sub

DelphiScript

procedure Test();
var testApp, params, profileParams, AQtimeObj;
begin

  testApp := TestedApps.Items('SampleApp');

  // Obtain the tested application's parameters
  params := testApp.Params;
  // Obtain the Profile run mode's parameters
  profileParams := params.ProfileParams;

  // Specify the AQtime version
  profileParams.AQtimeVersion := 8;

  // Specify that TestComplete will use an AQtime project to profile the tested application
  profileParams.UseProject := true;
  // Specify the path to the AQtime project that TestComplete will use
  profileParams.ProjectFileName := 'D:\Work Folder\Sample.aqt';

  // Specify that TestComplete sets the AQtime run mode after profiling starts
  profileParams.ForceRunMode := true;
  // Specify the AQtime run mode during profiling
  profileParams.RunMode := 'Normal';

  // Specify that TestComplete uses the profiler specified in the TestComplete project
  profileParams.OverrideProfiler := true;

  // Specify the name of the AQtime profiler that will be used to profile the application
  profileParams.ProfilerName := 'Performance Profiler';

  // Apply the modified parameters and activate the Profile run mode
  profileParams.Activate;

  // Launch the tested application
  AQtimeObj := testApp.Run;

  // Simulate user actions against the tested application
  // …

  // Wait until profiling is over and export the profiling results
  AQtimeObj.WaitAndExportResults('D:\Work Folder\SummaryResultsFile.xml', 'D:\Work Folder\ResultsFile.xml');

end;

C++Script, C#Script

function Test()
{

  var testApp = TestedApps["Items"]("SampleApp");

  // Obtain the tested application's parameters
  var params = testApp["Params"];
  // Obtain the Profile run mode's parameters
  var profileParams = params["ProfileParams"];

  // Specify the AQtime version
  profileParams["AQtimeVersion"] = 8;

  // Specify that TestComplete will use an AQtime project to profile the tested application
  profileParams["UseProject"] = true;
  // Specify the path to the AQtime project that TestComplete will use
  profileParams["ProjectFileName"] = "D:\\Work Folder\\Sample.aqt";

  // Specify that TestComplete sets the AQtime run mode after profiling starts
  profileParams["ForceRunMode"] = true;
  // Specify the AQtime run mode during profiling
  profileParams["RunMode"] = "Normal";

  // Specify that TestComplete uses the profiler specified in the TestComplete project
  profileParams["OverrideProfiler"] = true;

  // Specify the name of the AQtime profiler that will be used to profile the application
  profileParams["ProfilerName"] = "Performance Profiler";

  // Apply the modified parameters and activate the Profile run mode
  profileParams["Activate"]();

  // Launch the tested application
  var AQtimeObj = testApp["Run"]();

  // Simulate user actions against the tested application
  // …

  // Wait until profiling is over and export the profiling results
  AQtimeObj["WaitAndExportResults"]("D:\\Work Folder\\SummaryResultsFile.xml", "D:\\Work Folder\\ResultsFile.xml");

}

See Also

Run Modes and Parameters
Editing Desktop Application Parameters
Integration With AQtime
TestedAppProfileParams Object
TestedAppParams.ActiveParams
TestedAppParams.DebugParams
TestedAppParams.RunAsParams
TestedAppParams.SimpleParams
About Tested Applications

Highlight search results