There are three ways to profile script code with AQTime. They vary in the module that is added to the project: a host application, a script file or a URL. To profile a script file, add it to the list of profiled modules in AQTime’s Setup panel.
AQTime considers a file as a script file if it contains VBScript, JScript, C#Script or C++Script code, or if it contains HTML code in which <script> tags are used. Both the ASCII and Unicode encodings are possible. Typically, files that contain VBScript and JScript code have the .vbs and .js extensions.
Script files cannot be executed by themselves, they require that the host application be specified. For .vbs and .js files, the host application can be either Internet Explorer or Windows Script Host; for .htm and .html files the host application should be Internet Explorer.
This approach has another benefit: when a file is added to the Modules pane, AQTime retrieves data on available routines. Thus, you can select which script routines to profile in the same manner as for ordinary libraries and executables. See Using Areas.
To profile a script file, follow the instructions below:
Press the Add Module button on the Modules pane, or select Add Module from the pane’s context menu, or choose the Project > Add module item of the main menu.
In the ensuing Add Module To Project dialog, select the All Files or Script Files file mask and locate the desired script file. Press OK to add it to the AQTime project.
Optional. Choose the elements to be profiled by adding scripting routines to including or excluding areas.
Ensure that Normal is currently chosen in the Profiling Mode dropdown list box and select Run > Parameters from the main menuAQTime > Parameters from Visual Studio’s menuAQTime > Parameters from Developer Studio’s menu to call the Run Parameters dialog.
In the dialog, specify the host application and parameters for it. Depending on the script file type, do one of the following:
Select Internet Explorer from the Select generic host application drop-down list. Alternatively, if Internet Explorer is your default browser, you can select Default Web Browser from the drop-down list.
|Note:||Since version 8, Internet Explorer supports profiling script code written in JScript only. VBScript code profiling is not supported.|
Specify the URL or the path to the web script file in the Parameters field. This will make the browser navigate to the specified page upon starting.
Enter the path to any Windows Script Host executable, wscript.exe or cscript.exe, in the Specify custom host application field.
In the Parameters field, specify
//D //H:CScript followed by the fully qualified path to the file and script parameters (if any). This will enable the host’s built-in debugger and make the host application launch the specified script upon starting profiling in AQTime.
Select the desired profiler from the dropdown list on the Standard toolbar.
Select the desired profiler from the Profiler dropdown list in the AQTime menu.
Select the desired profiler from the Current Profiler submenu of the AQTime menu.
Press Run on the Standard toolbar or select Run > Run from AQTime’s main menu to start profiling. The host application will be launched automatically.
Select AQTime > Run from Visual Studio’s main menu to start profiling. The host application will be launched automatically.
Select AQTime > Run With Profiling from Embarcadero RAD Studio’s main menu to start profiling. The host application will be launched automatically.
Start the script routine(s) to be profiled. Depending on the script file type, various actions should be performed:
Typically, web page scripts are executed upon opening. However, sometimes, specific actions may be needed, for example, you may need to highlight elements, select menus, interact with the page’s controls and so on.
No additional actions are required as Windows Script Host automatically starts the script file specified as a parameter.