A tested application can be run in various modes. TestComplete includes a number of program objects that provide scripting access to parameters specific to these run modes. The TestedAppProfileParams
object contains properties specific to the Profile run mode.
To obtain the TestedAppProfileParams
object in your script, use the Params.ProfileParams
sub-property of the corresponding TestedApp
object. See Editing Desktop Application Parameters for details.
The following example demonstrates how to modify the tested application’s parameters in script:
JavaScript, JScript
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
DelphiScript
C++Script, C#Script
Run Modes and Parameters
Editing Desktop Application Parameters
Integration With AQtime
TestedAppParams Object
TestedAppDebugParams Object
TestedAppRunAsParams Object
TestedAppSimpleParams Object
About Tested Applications