This topic describes the specifics of test recording in TestComplete:
When recording a script or keyword test, TestComplete records user actions as actions on objects, not low-level events such as mouse movements or pressing and releasing mouse buttons and keys. That is, TestComplete does not record the precise mouse path and the delay between user actions, but it records mouse clicks and keystrokes that affect windows and controls. This object-oriented approach has several benefits:
It makes tests less dependent on the screen layout of windows and controls.
It makes the tests shorter and more readable.
The tests run faster than they were recorded.
However, in TestComplete, you can record low-level events and actual delays between user actions. To learn more, see About Testing Applications in Low-Level Mode.
When TestComplete records user actions, it traces and records keyboard and mouse events that these actions generate. Depending on the tested application, the recorded action may differ from the action you performed during the recording.
A typical example is that an application form can process keystrokes before they are sent to controls on this form. For instance, the form may handle a Space key press and select a radio button located on the form. In these cases, TestComplete will record the radio button selection rather than the Space keystroke.
TestComplete can map objects with which you interact in your tests. For each object, TestComplete creates an entry in the Name Mapping repository and specifies properties it uses to identify the object in the application uniquely. (To learn more about name mapping, see About Name Mapping). For mapped objects, TestComplete also creates aliases - custom names it uses to address objects in tests.
Depending on whether the Map object names automatically setting is enabled or not, and on whether the object is already mapped of not, TestComplete will address the object in the recorded tests in the following ways –
If the object is already mapped: by the object’s alias or by its mapped name if the object does not have an alias.
If the object is not mapped:
If the option is enabled, TestComplete will map the object, create an alias for it and use the alias to address the object in tests.
If the option is disabled, TestComplete will use the object’s default name. The default name depends on the object type (process, window, control) and its properties (for example, its
Caption and so on).
While recording a test, you cannot switch to the TestComplete main window. If you try to do this, TestComplete will show an appropriate message and will automatically pause the recording. To continue recording a test, click Continue in this message. To stop the recording and switch to the TestComplete main window, click Stop.
Depending on the Record text input into simple editors as option, TestComplete can record text input into single-line edit controls using either the
SetText method or the
Keys method. When TestComplete uses the
SetText method, the recorded test operation specifies the final value of the edit control before you switch to another object or stop the recording. When TestComplete uses the
Keys method, the recorded operation specifies the actual sequence of keys pressed to type in the edit control, including special keys like Backspace, Delete, Alt, Ctrl, F-keys, and so on.
Regardless of whether the Record text input into simple editors as setting is enabled or not, for multi-line edit controls, TestComplete always records text input by using the
Before TestComplete starts recording a test, it turns off the Caps Lock mode. It also does so before starting a test run. This guarantees that TestComplete will record and simulate keyboard input correctly.
TenAsys INtime runtime is known to interfere with the TestComplete recording engine. As a result, TestComplete may record test operations in a wrong order. To avoid the issue, uninstall INtime from your computer or record tests on a computer without INtime installed.
Test recording may depend on the type of your tested application. To learn more, see the following topics: