Checking Syntax

Applies to TestComplete 12.60, last modified on September 17, 2018

Correct syntax of script code is important for most of TestComplete subsystems. For instance, if the syntax is incorrect, TestComplete may be unable to automatically generate correct names for new recorded script routines and new event handlers, or code navigation in the Code Editor will not work. Also, scripts holding syntax errors cannot be executed: TestComplete automatically checks the syntax of your script routines before executing them and if the check fails, TestComplete cancels the script run.

You can check the script syntax by right-clicking the desired unit in the Project Explorer panel and selecting Check Syntax from the context menu. TestComplete will highlight the syntax error (if any) in the Code Editor.

Check Syntax Menu Item

TestComplete also checks the syntax when you are typing in the Code Editor. It shows the error mark () in the gutter for problematic lines. To view the error description, place the mouse over this mark:

Error Description

To quickly jump to the first syntax error in a unit, right-click somewhere within the unit code and choose Go to Error from the context menu.

The Code Explorer panel displays the error icon () for each unit and project containing syntax errors. By expanding the tree shown in the Code Explorer you can quickly find the unit with the error. To locate the line within the unit, double-click the Error node that is shown under a unit node. TestComplete will open the unit in the Code Editor and place the cursor at the line with the error.

Code Explorer Showing an Error
Note: Syntax checking means that TestComplete parses the script code and finds errors. Since parsing of large units requires a lot of time, TestComplete displays the parsing status in its status bar and disables some menu and toolbar items during the parsing process. For example, you cannot start the script routine execution during the syntax checking.

See Also

Code Editor
Code Editor Window - Overview
About Code Explorer
Code Completion

Highlight search results