Tracing Events and Exceptions With AQtime

Applies to TestComplete 15.47, last modified on January 20, 2023
Information in this topic applies to desktop applications only.

About AQtime

To trace exceptions and debug events that occur in your application during the test run, you can use the TestComplete AQtime support functionality. AQtime is a performance profiler and memory and resource allocation debugger by SmartBear. When you run an application under AQtime, the latter gathers various information about the application execution and monitors the application for events and exceptions.

The information which AQtime collects depends on the AQtime profiler that you selected before the run (the profiler is a “tool” that gathers information about the application). AQtime includes over a dozen of profilers that perform various analysis of an application: time the execution of routines and source code lines, track the allocation and deallocation of memory blocks, check the use of resources and so on. The information about events and exceptions is collected simultaneously with measuring other execution characteristics. See AQtime documentation.

Running Tested Applications With AQtime

The most easiest way to use AQtime for tracing tested applications is to use Profile run mode. If this mode is selected for a tested application, then when you command TestComplete to launch the application, it launches it under AQtime and then performs the test commands. So, during the run TestComplete is simulating user actions and AQtime is tracing the application execution.

  1. Prepare your application for AQtime.

    In order for AQtime to be able to profile your application, the application must be compiled with debug information. For complete information on preparing applications for AQtime, see AQtime documentation.

  2. Prepare your AQtime project.

    Launch AQtime and prepare your AQtime project for the run: enable the desired profiling areas, triggers and actions, set the needed options and so on.

    Close your AQtime project after you prepared it.

  3. Add your application to the Tested Applications list and select Profile run mode.

    For information on how to add your tested application to the project’s Tested Applications list, see Adding and Removing Project Items and Their Child Elements.

    To set Profile mode:

    • Right-click the TestedApps node in the Project Explorer and select Edit from the context menu to open the Tested Applications editor.

    • Select your application in the editor and choose Profile in the Run Mode drop-down list show in the Basic Parameters category.

    • TestComplete will automatically update the Run-Mode Parameters section of the editor according to the selected mode. You can now use this section to specify both the AQtime version for the run and the profiler to be used (see below). Also, it assists you in selecting the desired AQtime project.

      Note: It is recommended to change the Run mode value from Silent to Normal (see below).
    • Save the changes made to the tested application settings by selecting File | Save from the TestComplete main menu.

Now, you are ready to run the application. When you command TestComplete to launch your application, it will launch it in Profile mode. This behavior does not depend on whether you start the application from keyword test, script or through the TestComplete user interface.

Some Specifics of Using AQtime for Tracing Events and Exceptions

  • Running applications in Profile mode is available only if AQtime version 4 or later is installed and the tested application is compiled with debug information.

  • The information which AQtime collects depends on the AQtime profiler that you selected before the run (the profiler is a “tool” that gathers information about the application). AQtime includes over a dozen of profilers that perform various analysis of an application: time the execution of routines and source code lines, track the allocation and deallocation of memory blocks, check the use of resources and so on. Some of the profilers gather information during the application run, some other perform static analysis.

    To trace exceptions, you can use a profiler that runs the tested application. If you need to trace for exceptions only and skip collecting other information, we recommend using the Exception Trace profiler. If an error occurs in the profiled application, this profiler saves information on the exception type, code, address, call stack, and so on. All these data will help developers find the cause of the problem faster. For more information about it, see AQtime documentation.

  • The information about debug events and exceptions is displayed in the Event View panel of AQtime. The contents of this panel is not saved after you close your AQtime project. So, you have to save it manually after the test run is over. To do this:

    • Switch to AQtime and activate the Event View panel.

    • Choose Save All from the context menu of this panel. This will invoke the standard Save to File dialog.

    • Specify the desired file name in the dialog and click Save.

    Note that if AQtime is running in Silent mode, the Save File dialog will not appear. That is why we recommended to change AQtime’s Run mode to Normal (see above).

    An alternative to manual saving of the Event View panel contents is to command AQtime to output the event and exception information to a file:

    • In AQtime, select Options | Options from the main menu. This will invoke the Options dialog.

    • Choose Profiling Time | Event View | Display Events in category from the tree on the left the Options dialog.

    • In the right part of the dialog, select the Active check box in the Text file or XML file sections and specify the desired file name.

    • Click OK to save the changes and to close the dialog.

    Now AQtime will output information about debug events and exceptions to the specified file, so you will not have to export the Event View panel contents after the test run is over.

Running an application in Profile mode means running it under AQtime - SmartBear’s profiler and memory debugger product. When you are launching your tested application in this mode, TestComplete is simulating user actions over the application and AQtime is profiling the execution of application’s functions and modules. After test run is over, the profiling results are included into the TestComplete test log. To review and analyze these results, you need AQtime to be installed on your computer. For more information on this, see Integration with AQtime.

AQtime includes several profilers that analyze various aspects of the application behavior. For instance, it can time the execution of application’s functions, trace exceptions, detect memory leaks, track resource usage, and so on.

To trace the exceptions and get the call stack, we recommend that you use AQtime’s Exception Trace Profiler. If an error occurs in the profiled application, this profiler saves information on the exception type, code, address, call stack, and so on. All these data will help developers find the cause of the problem faster. For more information about it, see AQtime documentation.

Running applications in Profile mode is available only if AQtime version 4 or later is installed and the tested application is compiled with debug information.

For more information on tracing applications running in Profile mode, see Integration with AQtime.

See Also

Tracing Exceptions, Crashes and Freezes in Tested Applications
Tracing Exceptions, Crashes and Freezes - Overview
Integration With AQtime
AQtime

Highlight search results