Syntax Highlighting

Applies to TestComplete 14.40, last modified on April 22, 2021

The TestComplete Code Editor uses different colors to display different code elements: identifiers, reserved keywords, comments, string constants, etc. This helps you better orient yourself in script code.

The Code Editor provides different syntax highlighting for different languages. You can change them using the Highlighting Settings page of the Editor Options dialog. The changes made in this dialog is common for all script units regardless of their language. For instance, both VBScript and JScript units will use the same highlighting settings.

The dialog lets you specify the desired highlighting for any code elements: comments, strings, brackets, etc. You can also specify highlighting settings for custom elements. That is, you can define some strings as user keywords and command TestComplete to apply special highlights to them. To do this:

  • Define user keywords:

    • Click the Call the Panel Options Dialog button on the Code Editor’s toolbar. This will call the Options dialog. Also, you can do it by right-clicking somewhere within the Code Editor and selecting Panel Options from the context menu.

    • Select Panels | Code Editor | User Keywords from the tree on the left of this dialog. This will show the list of user keywords on the right of the dialog.

    • Type the desired string into the list of user keywords.

  • Specify the highlighting settings for user keywords:

    • Select Panels | Code Editor | Highlighting from the tree on the left of the Options dialog. This will show the highlighting settings on the right of the dialog.

    • Select User keywords in the list of elements and then modify the highlighting settings (color and font attributes) using the edit fields on the right.

    • Press OK to save changes.

Note that when you copy text to the clipboard, TestComplete also copies the color and font attributes. For example, when you paste the copied text to WordPad or any other rich-edit application, the color highlighting will be the same as it was in the TestComplete Code Editor.

See Also

Highlighting Settings
User Keywords Options
Code Editor

Highlight search results