Record and Playback are used to record the user actions in the form of scripts and Play them back at a later time by running the script.
Using record option UFT users can build automation scripts automatically without having any knowledge of scripting.
Recording Modes: There are four recording modes in the UFT.
- Normal Recording
- Analog Recording
- Low Level Recording
- Insight Recording
1. Normal Recording Mode:
It records the actions performed by the user on the application objects like Edit boxes, List boxes and Links. UFT records each action as one step in the UFT script. Step is nothing but one line in the code. The Default recording mode is the Normal Recording Mode.
Normal Recording Script:
Browser(“QA Engineering And Web”).Page(“QA Engineering And Web”).Link(“ALM”).Click
Browser(“QA Engineering And Web”).Page(“ALM | NH-TECH”).Link(“About”).Click
Browser(“QA Engineering And Web”).Page(“About Me”).Sync
Browser(“QA Engineering And Web”).CloseAllTabs
2. Analog Recording Mode:
This mode enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window. This mode is useful when you want to record mouse movements, for example, recording a signature or drawing performed by dragging the mouse.
To record in analog mode, first start normal recording, then selects Recording Mode > Analog Recording. The Analog recording dialog box opens up.
Record relative to the screen: UFT records any mouse movement or keyboard input relative to the top left coordinates of your screen (i.e. Desktop).
Record relative to the following window: UFT records any mouse movement or keyboard input relative to the coordinates of the specified window.
Analog Recording Script:
3. Low Level Recording:
The low level recording mode is used only when exact coordinate of the operation is essential. To record a test using low level recording mode, start the normal recording session, then select Recording Mode > Low Level Recording to start recording in low level.
Low Level Recording Script:
Window(“Internet Explorer”).WinObject(“Internet Explorer_Server”).Click 971,170
Window(“Internet Explorer”).WinObject(“Internet Explorer_Server”).Click 269,434
Window(“Internet Explorer”).WinObject(“Internet Explorer_Server”).Click 704,368
Window(“Internet Explorer”).WinObject(“Internet Explorer_Server”).Click 840,396
4. Insight Recording:
UFT records operation based on its appearance and NOT based on its native properties.
Insight Recording Script:
Browser(“QA Engineering And Web”).InsightObject(“InsightObject”).Click
Browser(“QA Engineering And Web”).InsightObject(“InsightObject_2”).Click
Browser(“QA Engineering And Web”).InsightObject(“InsightObject_3”).Click
How to Choose Recording Modes
Upon clicking on recording button, the user can choose the recording mode from the recording pane that appears on the screen once recording starts. The selection can be made from any ones.
Guidelines for Choosing the Recording Mode:
- Use Analog recording mode only when the normal recording mode does not accurately record your operations.
- Use analog recording for the applications in which the actual movement of the mouse is what you want to record, like drawings, signatures etc.
- Use low level recording when you need to record the exact location of the operation on your application screen.
UFT always run from the first step, unless you specify. To run a test, open it and select Run > Run or press F5. The Run dialog box opens, in the dialog box, specify the result location. Temporary run result folder saves run results in a temporary folder. This option overwrites any results previously saved in this folder. Click OK to start the Run session.
Test Result Window:
When a run session ends, you can view run session results in the Test Results window. The run result tree is located in the left pane in the Test Result window.