Applies to TestComplete 14.20, last modified on September 11, 2019

This topic contains instructions on how to accomplish typical tasks in the Keyword Test editor and its Test Steps page:

Adding New Operations to Tests

To add a new operation to the test, do any of the following:

  1. Find the desired operation in the Operations panel. Click the operation there.

    Note: After you clicked an operation in the Operations panel, the operation becomes “selected for addition”. To cancel the selection, press Esc.
  2. Move the mouse pointer to the test area of the page. While you are moving the mouse pointer, TestComplete changes the pointer to reflect the position to which the operation will be inserted.

  3. Click within the test area to add the operation to the specified position.

  4. If the operation has parameters, after you clicked within the test area, TestComplete will display a dialog asking you to specify the operation’s parameters. Set the desired values and save the changes. The operation will be added to the test. If you click Cancel in the dialog, the operation will not be added.

-- or --

  1. Right-click the desired Keyword Test editor and choose the needed operation from the Insert New Operation submenu of the context menu.

  2. If you cannot find the needed operation in the list, select Insert New Operation | More Operations and choose the operation in the ensuing Insert Operation dialog.

  3. The new operation will be inserted after the operation that is currently selected in the editor.

The operations that you use more often than other operations will be displayed in the Frequently Used category. This category is hidden if you have not added any operations to your tests on the current computer. It becomes visible after you add at least one operation.

Adding Operations that Work with the Same Object as Existing Operations

To simulate user actions, you use the On-Screen Action operation. When adding this operation to your test, you specify the window or control with which the operation will work. If the test contains an On-Screen Action operation, you can add another On-Screen Action operation that works with this object and skips the object selection. To do this:

  1. Right-click the existing On-Screen Action operation in the Test Steps page.

  2. Choose Add Operation With Same Target Object from the context menu. TestComplete will “remember” the object’s name and change the cursor to indicate that the editor is working in the operation insertion mode.

  3. Click within the editor to specify the position to which the new operation will be inserted. TestComplete will then display the Operation Parameters wizard where you can specify parameters of the new operation.

Recording Operations into the Current Test

You can command TestComplete to record user actions and insert them into the current keyword test. This feature makes editing faster and easier because it can be easier to record user actions than to add appropriate operations to the test manually.

To record operations into the current test:

  1. In the test, select the operation after which the recorded commands will be inserted.

  2. Select Append to Test from the editor’s toolbar to start recording.

  3. If the Specify the position to append the operation to option is enabled (default), TestComplete displays a message asking you where to append the recorded operation. Click To Current Position to add recorded operations to the keyword test after the selected operation. If you click this button and no operation is selected in the Keyword Test editor, the recorded operations will be added to the end of your keyword test.

For more information on recording keyword tests, see Creating and Recording Keyword Tests.

Making Operations Children of Other Operations
  • Select an operation you would like to make a child in the test and then drag it to the operation you would like to be the parent.

    Keep some distance from the editor’s left border when moving the mouse cursor. If you drag it closer to the left border, the drag action will change the operation’s position in the test, not the parent-child relationship. The mouse pointer will indicate the insertion point for the operation being dragged:

    Making an operation a child operation

-- or --

  • Position the operation you would like to make a child after the operation you would like to make the parent in the test.

  • Press Ctrl+Right Arrow or click on the editor toolbar to make the operation a child operation of the operation above it.

    To remove an operation from the child list, select it in the test and press Ctrl + Left Arrow or click on the editor toolbar.

Searching for Operations in the Operations List

All available operations are organized into categories. To find the needed operation, you can skim through the operations list by expanding and collapsing the categories.

To search for an operation by its name, type the name of the desired operation into the edit box that is above the operations list. While you are typing, TestComplete filters the contents of the panel and displays operations whose names contain the typed letters and words.

To cancel the search, press ESC or click the button.

Changing Operations' Position

To change an operation’s position, select the needed operation in the test and then do any of the following:

  • Drag the operation to the needed position. While dragging, TestComplete changes the mouse pointer to indicate the position to which the operation will be inserted.

-- or --

  • Press Ctrl + Arrow Keys to move the operation to the needed position in the test.

-- or --

  • Use the , , or item on the editor toolbar to move the operation.
Copying, Cutting and Pasting Operations

To copy or cut an operation to the clipboard:

  1. Select the desired operation in the test (you can use Ctrl+ and Shift-click for multiselection).
  2. Right-click the selected operation (or operations) and choose the Copy (or Cut) from the context menu. The operation will be copied (or cut) to the clipboard.

To insert the copied operation from the clipboard to the test:

  1. Right-click the operation, after which you would like to insert the copied operation.

  2. Select Paste.

Note: If you copy an operation that has the Visualizer frame associated with it and then paste this operation to your test, the pasted operation will not have the Visualizer frame.
Modifying Operation Parameters
  • Double-click the desired operation. TestComplete will display the wizard where you can view and modify the operation’s parameters.

-- or --

  • Click the desired cell twice (not double-click) or select it and press F2.

  • To change the object to which the operation is applied:

    • Enter the name of the desired object in the in-place editor. You can specify either the object’s full name or its full mapped name or alias.

    -- or --

    • Click the ellipsis button within the cell and choose the desired object visually from the ensuing Select Object dialog.

    To change the object’s method to be called:

    • Select the desired method from the drop-down list or simply type the method name.

    To change the operation’s parameter values:

    • Click the ellipsis button within the cell and specify the desired values using the ensuing Operation Parameters dialog.

    -- or --

    • Enter the parameters list into the in-place editor.

      If the operation has several parameters, they are separated with commas.

      String values must be enclosed with quotes (JavaScript, JScript, Python, VBScript, C#Script and C++Script projects) or with apostrophes (DelphiScript projects). For instance, "My string" or 'My string'.

    To change the operation’s description:

    • Enter the new description into the in-place editor.

  • After changing the desired value, press Enter to confirm the changes and close the in-place editor or Esc to cancel the changes.

Searching within Operation Parameters' Values
  1. Select Edit | Find from the TestComplete main menu or press Ctrl+F. The Find dialog appears.

  2. In the dialog, specify the value you wish to find (you can use regular expressions or wildcards in this value) and the search options, such as case sensitivity, whole word matching, search direction and others.

  3. Click Find Next to search for the next occurrence of the sought-for value in your keyword test.

    To find all occurrences of the sought-for value, click Find All. You will get a list of all found matches in the Search / Replace Results panel. (If this panel is hidden, select View | Select Panel from the TestComplete main menu and then select Search / Replace Results from the ensuing Select Panel dialog).

Note: TestComplete supports search only through data in the Value column.
Replacing Operation Parameters' Values
  1. Select Edit | Replace from the TestComplete main menu or press Ctrl+H. The Replace dialog appears.

  2. In the dialog, specify the sought-for value (it can include regular expressions or wildcards) and the value to replace it with, along with the search options.

  3. Click Replace to replace the next occurrence of the sought-for value in your test.

    To replace all occurrences of the sought-for value, click Replace All. You will see detailed replacement results in the Search / Replace Results panel. (If this panel is hidden, select View | Select Panel from the TestComplete main menu and then select Search / Replace Results from the ensuing Select Panel dialog).

Note: TestComplete supports data replacement within the Value column only.
Deleting Operations
  1. Select the desired operation in the test (you can use Ctrl+ and Shift+ click for multiselection).

  2. Press DEL or right-click the operation and select Delete from the context menu.

If you delete an operation that has the Visualizer frame associated with it, the frame will be deleted as well.
Enabling and Disabling Operations
Adding and Removing Grouping Nodes

TestComplete uses grouping nodes to group operations that were executed subsequently in the same window or processes (see the description of grouping nodes). Grouping nodes correspond to the tested process or window, and operations are displayed as child nodes of these grouping nodes.

The grouping nodes are added automatically during the test recording or when you add several operations that work with the same window or process and reside in the test one after another.

When you delete a grouping node, TestComplete removes the node along with its child nodes. If the grouping node does not contain any other operations, it is automatically removed.

Viewing and Specifying Test Descriptions

You can save a description along with your keyword test. To view the text, click Show Description on the editor’s toolbar. The description will appear below the toolbar. The description is visible when this button is pressed and hidden when the button is released.

To modify the description, click Edit to the right of it. This will activate the in-place editor in which you can type the desired text. To confirm the input, click Apply, to discard the changes, press Esc.

Adding Variables to Tests
  1. Click Add Variable on the editor’s toolbar. This will invoke the Add Variable wizard.

  2. In the wizard, specify the variable’s name, description and value.

For more information on test variables, see Keyword Test Variables.

Creating Test Parameters
  1. Click Add Parameter on the editor’s toolbar. This will invoke the Add Parameter wizard.

  2. In the wizard, specify the parameter’s name, description and value.

For more information on parameters, see Keyword Test Parameters.

Running Tests

To execute the current test, press Run Test on the editor’s toolbar. See also Running Keyword Tests.

Debugging Tests

On the Test Steps page of the Keyword Test editor you can also set breakpoints and debug keyword tests. For detailed information about this, see Debugging Tests.

See Also

Keyword Tests
About Keyword Testing
About Keyword Test Editor
Creating and Recording Keyword Tests
Testing Mobile Applications

Highlight search results