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:
-
Press the down arrow on the right of the Checkpoint button.
-
Select the needed checkpoint type.
-
Follow the instructions of the ensuing wizard.
-
Click Finish when you have specified all parameters for the selected checkpoint.
-
Click Copy in the Copy Text to Clipboard dialog.
-
Paste the text from the clipboard to the needed place in your script.
Debug routines
To start debugging the desired routine, do the following:
-
Right-click somewhere within the needed routine’s declaration.
-
Select Debug from the ensuing context menu.
-
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:
-
Type the name of the property or method that has at least one parameter – for example,
Log.Message()
. -
Click within the brackets after the specified name.
-
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:
-
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.
-
Select the name of the desired template and press ENTER.
-
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.
Navigate to element declaration
Insert bookmarks
To insert a bookmark, do the following:
-
Right-click somewhere within the Code Editor.
-
Select Toggle Bookmarks from the context menu.
-
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:
-
Right-click the name of the entity you want to rename (that is, a variable or function).
-
In the context menu, select Rename Variable or Rename Function.
-
In the subsequent dialog, specify a new name for your entity.
-
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.