Debugging Tests - Specifics

Applies to TestComplete 15.64, last modified on May 16, 2024

In TestComplete you can debug script code and keyword tests. You can debug scripts and keyword tests directly in the Code Editor or Keyword Test editor. Debugging of scripts and keyword tests are similar to each other and have the following specifics:

  • Debugging works only if the  Enable Debugging item is checked on the Test Engine toolbar.

  • The debugger is off, if the project is executed in TestExecute or if TestComplete was opened in Silent mode.

  • As you step through script code or keyword test, the focus moves between the Code Editor or Keyword Test editor and the window of the tested application. After executing each script line or operation, TestComplete deactivates the tested application window and moves the focus to the editor. Before executing the next line, TestComplete re-activates the tested application window.

    There are some pieces of test actions that cannot be interrupted in this way. For example, one line or operation brings up a popup window. Switching to another application (for example, TestComplete) hides this window. If the next line (operation) performs any actions with the popup window (now hidden), incorrect results will follow.

    This can also happen with in-place editors for tree view controls. Almost all applications allow users to change the text of a node directly within the tree view. The in-place editors are automatically hidden when another application becomes active. So, again, if one script line or keyword test operation activates an in-place editor, while stepping in debug mode, the editor will be hidden by the time the next script line or operation tries to access it.

    To rectify this, avoid stepping through each line of this kind of code (or through each operation of keyword test). You can set breakpoints before and after the piece of test that requires no interruption. Alternatively, you can use Step Over to skip the entire script piece or you can place the cursor at that script piece and use the Running to the Cursor command. For either of these, the debugger executes the script or keyword test while leaving the focus with the tested application.

  • Using the Highlight execution point setting slows the execution of the test. As well as monitoring many expressions at once in the Watch List panel, especially if they involve a lot of calculations.

  • Python and JavaScript (not JScript) engines do not support the Set Next Statement debugger command.

See Also

Debugging Tests
Debugging Tests - Overview

Highlight search results