RunMode Property

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

Description

A tested application can be run in Profile mode. In this mode, TestComplete launches AQtime and then starts the application under AQtime. The RunMode property specifies a run mode for AQtime. Do not confuse this property with the run mode for tested applications.

The RunMode property is the same as the Run mode value specified for the application in the Tested Applications editor.

Declaration

TestedAppProfileParamsObj.RunMode

Read-Write Property String
TestedAppProfileParamsObj An expression, variable or parameter that specifies a reference to a TestedAppProfileParams object

Applies To

The property is applied to the following object:

Property Value

One of the following strings that specify the desired run mode for AQtime:

String Description
Normal AQtime will run in its normal mode as if you started profiling from it.
Silent AQtime will not display any dialog boxes and messages during the run. If a dialog should be displayed, the default processing will be applied.
Errors and Warnings  AQtime will display error and warning messages that may be displayed during profiling.
Errors Only AQtime will display error messages only.

Remarks

If you assign a value to this property, TestComplete will treat your project as modified. So, you will need to save or cancel changes when closing the project. The specified value will be displayed in the TestedApps editor.

Note: TestComplete starts and controls AQtime via COM. If AQtime is launched this way, it always functions in Silent mode. When profiling is over, TestComplete changes the AQtime mode to the mode specified by the RunMode property. This lets you analyze profiling results using AQtime’s dialogs (in Silent mode no dialogs are displayed). If you want TestComplete to apply the mode right after the profiling starts, use the TestedAppProfileParams.ForceRunMode property.

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

ForceRunMode Property
About Tested Applications
Run Modes and Parameters
Editing Desktop Application Parameters
Integration With AQtime

Highlight search results