Code Editor - Common Tasks

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

This topic describes common tasks you can accomplish with scripts displayed in the Code Editor.

Run routines

To run the desired routine, do any of the following:

  • Right-click somewhere within the routine’s declaration and select Run This Routine from the ensuing context menu.
  • Click somewhere within the routine’s declaration and click the button on the Code Editor’s toolbar.
Insert checkpoints

To insert a checkpoint into the test, do the following:

  1. Press the down arrow on the right of the Checkpoint button.

  2. Select the needed checkpoint type.

  3. Follow the instructions of the ensuing wizard.

  4. Click Finish when you have specified all parameters for the selected checkpoint.

  5. Click Copy in the Copy Text to Clipboard dialog.

  6. Paste the text from the clipboard to the needed place in your script.

Debug routines

To start debugging the desired routine, do the following:

  1. Right-click somewhere within the needed routine’s declaration.

  2. Select Debug from the ensuing context menu.

  3. Select the needed action from the sub menu that appears.

For more information, see Debugging Tests.

Call Code Completion window

To call the Code Completion window, do any of the following:

  • Right-click somewhere within the Code Editor and select Code Completion from the ensuing context menu.

  • Click somewhere within the code line and press CTRL + SPACE.

The Code Completion window may also pop up automatically when you are typing the text. For this purpose, enable the Auto Pop-Up option.

Obtain parameters description

To obtain the description of parameters that belong to the specified method or property, do the following:

  1. Type the name of the property or method that has at least one parameter – for example, Log.Message().

  2. Click within the brackets after the specified name.

  3. Press CTRL + SHIFT + SPACE.

Check syntax

TestComplete 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.

For more information, see Checking Syntax.

Insert code templates

To insert a code template, do any of the following:

  1. Right-click within the Code Editor and select Code Templates from the ensuing context menu. As an alternative, you can press the CTRL + J shortcut within the Code Editor.

  2. Select the name of the desired template and press ENTER.

  3. If the selected template has at least one parameter, TestComplete will ask for their values.

-- or --

  • Type the name of the desired template and press Tab.

For more information, see Code Templates.

Insert bookmarks

To insert a bookmark, do the following:

  1. Right-click somewhere within the Code Editor.

  2. Select Toggle Bookmarks from the context menu.

  3. Select the name of the inserted bookmark from the ensuing sub menu.

For more information, see Bookmarks.

Configure editor options

To call the options of the Code Editor, do any of the following:

  • Click the  Call the Panel Options Dialog button on the Code Editor toolbar.

  • Right-click somewhere within the Code Editor and select  Panel Options from the ensuing context menu.

Rename entities

To rename variables and functions within your code, do the following:

  1. Right-click the name of the entity you want to rename (that is, a variable or function).

  2. In the context menu, select Rename Variable or Rename Function.

  3. In the subsequent dialog, specify a new name for your entity.

  4. Click OK.

For more information, see Renaming Functions and Variables.

Zoom in and zoom out

To zoom in or zoom out, scroll you mouse wheel up or down while holding the CTRL key pressed.

You can view the current zoom level in the editor status bar.

See Also

Code Editor
About Code Editor
Code Completion

Highlight search results