Debug JavaScript functions

After you design the JavaScript functions that implement your test object operations and property retrieval, you can test and debug them using Extensibility Accelerator. You do not need to have UFT One installed to do this.

You can run a selected test object operation or retrieve the value of a selected property for a control that you select in your application. Extensibility Accelerator performs the test object operation or retrieves the property value by running the JavaScript function that you designed to support it, just as UFT One would during a run session. This enables you to test and debug the support you designed.

Debugging methods

While your JavaScript function runs, you can debug it using debugging tools or console output.

Microsoft Visual Studio JavaScript Debugger

If you are running on Microsoft Internet Explorer, you can debug your JavaScript functions as you would in a regular Microsoft Visual Studio JavaScript debugging session.

For example, if you set a breakpoint in your function before running the operation, the run session stops at the breakpoint if it is reached.

You can also add breakpoints, use step commands and other Debug menu commands and toolbars, or use the various debugging-related windows such as Watch and Output. For details, see the MSDN Visual Studio Help.

Google Chrome DevTools

Extensibility Accelerator version 2022 or later:

 If you are running on Google Chrome, you can press F12 to open DevTools and use it to debug your functions.

Tracking output

If you do not want to use debugging tools, you can add output messages to your code to help debug it. Alternatively, you can call _util methods, which result in messages being printed in the Extensibility Accelerator Output window (Debug > Windows > Output), specifying the method called and the parameters passed.

Note: _util methods are relevant only when running in the UFT One context. Therefore, if the JavaScript functions that you run include calls to _util methods, these calls are not carried out when they are encountered during the debugging process. Instead, a message is printed in the Extensibility Accelerator Output window specifying the method call and the parameters it passed.

See also: