To add a new operation to the test, do any of the following:
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.|
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.
Click within the test area to add the operation to the specified position.
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 –
Right-click the desired Keyword Test editor and choose the needed operation from the Insert New Operation submenu of the context menu.
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.
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.
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:
Right-click the existing On-Screen Action operation in the Test Steps page.
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.
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.
It is easier and faster to record user actions than to add the appropriate operations to the test manually:
In the test, select the operation after which the recorded commands will be inserted.
Click Record on the editor toolbar.
TestComplete will show a message in which you can specify where to append the recorded operations.
Click Add to Current Position to add the recorded operations to the keyword test after the operation that is currently selected.
Note: If no operation is selected, the operations will be added to the test end.
Click Add to End to add the recorded operations to the end of the keyword test.
Click Record New Test to create a new keyword test and add recorded operations to that test instead.
For more information on recording keyword tests, see Creating and Recording Keyword Tests.
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:
– 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.
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.
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 –
– or –
To copy or cut an operation to the clipboard:
To insert the copied operation from the clipboard to the test:
Right-click the operation, after which you would like to insert the copied operation.
|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.|
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.
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.
Select Edit > Find from the TestComplete main menu or press Ctrl+F. The Find dialog appears.
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.
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.|
Select Edit > Replace from the TestComplete main menu or press Ctrl+H. The Replace dialog appears.
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.
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.|
Select the desired operation in the test (you can use Ctrl+ and Shift+ click for multiselection).
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.|
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.
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.
Click Add Variable on the editor’s toolbar. This will invoke the Add Variable wizard.
In the wizard, specify the variable’s name, description and value.
For more information on test variables, see Keyword Test Variables.
Click Add Parameter on the editor’s toolbar. This will invoke the Add Parameter wizard.
In the wizard, specify the parameter’s name, description and value.
For more information on parameters, see Keyword Test Parameters.
To execute the current test, click Run on the editor toolbar. See also Running Keyword 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.