You can create automated tests quickly by recording actions in desktop, web and mobile applications. You can record data input, item selection, website navigation, form submission, mobile gestures and other user actions. You can also create checkpoints during test recording. You can record keyword tests, scripts, and low-level procedures.
After recording a test, you can review and edit it.
Starting, pausing and stopping recording
To start test recording, do any of the following:
Click Record Keyword Test or Record Script on the Test Engine toolbar.
Select Test > Record > Record Keyword Test or Test > Record > Record Script from the TestComplete main menu.
Click Record on the toolbar of the Keyword Test editor.
Click Record Test on the Start Page.
If no project is open, TestComplete will show the Record Test wizard that will guide you through creating and configuring a project for your test. Then TestComplete will start recording.
TestComplete will show the Recording toolbar where you control the recording process.
To pause recording, click Pause on the Recording toolbar or press Shift+F10.
To resume recording, click Record on the Recording toolbar or press Shift+F1.
To stop recording, click Stop on the Recording toolbar or press Shift+F2.
|Tip:||You can change the shortcuts in the Global Shortcuts dialog.|
Appending recordings to the current keyword test
If you use keyword tests, you can append the recorded operations to existing tests instead of recording new tests:
Open the test in the Keyword Test editor.
Click Record on the editor’s toolbar.
If TestComplete shows a message prompting you to specify where to append the recorded operations, click Add To End.
To append the recorded operations after a specific operation:
Open the test in the Keyword Test editor.
Select the operation after which you want to add the recorded operations.
Click Record on the editor’s toolbar.
If TestComplete shows a message prompting you to specify where to append the recorded operations, click Add To Current Position.
After recording has started
When you start recording, TestComplete:
Switches to the Recording mode and displays the Recording toolbar.
Minimizes the TestComplete main window (this depends on the Minimize TestComplete option, which is enabled by default).
Saves the changes made to the current project (this depends on the Save before recording option, which is enabled by default).
Creates a new script routine or keyword test where the test actions will be saved.
Turns off the Caps Lock key. TestComplete also turns off the Caps Lock key when starting a test run. This ensures that TestComplete will correctly simulate keystrokes.
Starts the tested applications that have the Autorun application on recording option enabled.
Displays the Mobile Screen window. This window is used when testing mobile applications (this depends on the Automatically display Mobile Screen when recording option, which is disabled by default).
Things that can be done during test recording
Besides recording actions in your tested application, you can do the following during test recording:
When recording tests for desktop and web applications, create quick property checkpoints:
Record multi-touch gestures on Android device. For instructions, see Recording Gestures (Multi-Touch Events) (Legacy).
Launch applications that you added to the Tested Applications collection.
You can also run applications in a usual way - by using a desktop shortcut, Start menu and so on. TestComplete can trace the application startup and record the appropriate commands (see below).
Launch a mobile browser emulator for mobile web testing.
Switch between keyword test, script and low-level recording (see below).
Insert comments into the recorded tests using the Add Comments button on the Recording toolbar.
Recording the application start
TestComplete traces the start of applications during the recording. After the recording is over, TestComplete may add test actions that will automatically start these applications. Depending on the application’s type, this is done in different ways:
To manage tested applications, TestComplete projects use the Tested Applications collection. You can add applications to this collection when you are creating a TestComplete project, or do this any time later. TestComplete also can add applications to this collection automatically.
During the test recording, TestComplete detects the launches of Windows applications. By default, it checks whether the launched application is added to the Tested Applications list, and if it is not, TestComplete displays a message box asking your permission to add the application to the list. If you confirm the addition, TestComplete will include the application into the list and insert the Run TestedApp keyword test operation or the
TestedApps.ProgramName.Run(1, True) script instruction into your test.
To change the default behavior, use the Add applications to the list of tested applications setting. To view or change it, select Tools > Options from the TestComplete main menu and then choose Engines > Recording in the subsequent dialog). By default, the setting is enabled and TestComplete adds applications to the Tested Application collection.
There is another setting, Show 'Add <ApplicationName> to the list of tested applications?' message, that controls whether TestComplete asks your approval before adding the application. You can find this setting in the Tools > Options > General > Show Again Flags dialog. If the “Show...” setting is disabled and the “Add...” setting is enabled, then all desktop applications that you start during the recording will be automatically added to the Tested Applications collection of your project.
TestComplete detects the launch of supported web browsers during the recording and automatically inserts the Run Browser keyword test operation or
Browsers.Item().Run() script instruction into the recorded test.
TestComplete does not include Web applications into the Tested Applications list automatically.
When recording cloud-compatible mobile tests, TestComplete detects opening a testing session for your application or connecting to an existing session, and adds the appropriate command to the recorded test automatically.
When recording legacy mobile tests, TestComplete cannot trace the start of the mobile application. Therefore, it cannot record the appropriate test command automatically. To automate the application start in your tests, add your Android or iOS application to the Tested Applications collection of your project manually and then insert the appropriate commands in your tests.
Changing the type of the recorded test
TestComplete can record tests as –
You start recording either a keyword test or a script, but you can switch to another test type at any time during recording. To do this, use the corresponding buttons on the Recording toolbar.
When you switch to another recording mode, TestComplete inserts a call to the new test into the previously recorded test so that these tests can be played back in sequence. For example, if you switch from keyword test recording to low-level recording, TestComplete will insert a call to the low-level procedure into the keyword test.
Default names of recorded tests
TestComplete automatically names new keyword tests and scripting routines. The name of a newly recorded test or routine looks like
TestN, where N is a number. TestComplete generates a name that does not coincide with the names of the existing keyword tests or other routines in the scripting unit.
Recording various types of tests
For information about recording various types of tests, see:
Recording options and specifics
TestComplete has options that affect the recording process. To view or change them, you can do any of the following:
At design time, select Tools > Options from the TestComplete main menu and then select the Engines > Recording category.
During the test recording, click on the Recording toolbar.
For a full list of the options, see Recording Options Dialog.
For specifics of recording tests for different types of applications and UI elements, see Recording Specifics.