Wednesday, January 31, 2007

Recording Modes in QTP(Part-2)

Analog Recording
1.1 Analog Recording:
Enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window.

In this recording mode, QuickTest records and tracks every movement of the mouse as you drag the mouse around a screen or window.

This mode is useful for recording operations that cannot be recorded at the level of an object, for example, recording a signature produced by dragging the mouse.
1.2 Recording in Analog Mode

Click the Record button to begin recording.

Click the Analog Recording button or choose Test > Analog Recording. The Analog Recording Settings dialog box opens.

Select from the following options:
Record relative to the screen—records mouse movement or keyboard input relative to the coordinates of your screen, regardless of which application(s) are open.

Record relative to the following window—QuickTest records any mouse movement or keyboard input relative to the coordinates of the specified window.

If you choose to Record relative to the following window, click the pointing hand and click anywhere in the window on which you want to record in analog mode.

Click Start Analog Record. Perform the operations you want to record in analog mode.

When you are finished and want to return to normal recording mode, click the Analog Recording button or choose Test > Analog Recording to turn off the option.

Notes:
When you record in analog mode relative to the screen, the test run will fail if your screen resolution or the screen location on which you recorded your analog steps has changed from the time you recorded.
All of your keyboard input, mouse movements, and clicks are recorded and saved in an external file. When QuickTest runs the test, the external data file is called. It tracks every movement and click of the mouse to replicate exactly the operations you recorded.

If you chose to Record relative to the screen, QuickTest inserts the RunAnalog step under a Desktop parent item.
For example: Desktop.RunAnalog "Track9"

If you chose to Record relative to the following window, QuickTest inserts the RunAnalog step under a Window parent item. For example:
Window("Microsoft Internet").RunAnalog "Track8"

The track file called by the RunAnalog method contains all your analog data and is stored with the action.

Tip: To stop an analog step in the middle of a test run, click Ctrl + Esc, then click Stop in the test toolbar.
1.2.2 Low-Level Recording

Enables you to record on any object in your application whether or not QuickTest recognizes the specific object or the specific operation.

This mode records at the object level and records all run-time objects as Window or WinObject test objects.

Use low-level recording for recording tests in an environment or on an object not recognized by QuickTest or if the exact coordinates of the object are important for your test
1.2.3 Recording in Low-Level mode

Click the Record button to begin a recording session.

Click the Low Level Recording button or choose Test > Low Level Recording.

When you are finished and want to return to normal recording mode, click the Low Level Recording button or choose Test > Low Level Recording to turn off the option.
Notes:
In low-level recording and your entire keyboard input and mouse clicks are recorded based on mouse coordinates. When test is run, the cursor retraces the recorded clicks.
Suppose you type the word mercury into a user name edit box and then click the Tab key while in normal recording mode. Your script are displayed as follows:

Browser("Mercury Tours").Page("Mercury Tours") .WebEdit("username").Set "mercury"

If you perform the same action while in low-level recording mode, the script is recorded as follows

Window("Microsoft Internet").WinObject("Internet Explorer_Se").Click 29,297
Window("Microsoft Internet").WinObject("Internet Explorer_Se").Type "mercury" + micTab

1.2.4 Configuring Web Event Recording
The Web Event Recording Configuration dialog box offers three standard event-configuration levels.
By default, Quick Test uses the Basic recording -configuration level.
If Quick Test does not record all the events you need, you may require a higher event-configuration level.

Level
Description
Basic
( Default )


•Always records click events on standard Web objects such as images, buttons, and radio buttons.
•Always records the submit event within forms.
•Records click events on other objects with a handler or behavior connected.
Records the mouse over event on images and image maps only if the event following the mouse over is performed on the same object and is dependent on the mouse over event.
Medium
Records click events on the
, , and HTML tag objects, in addition to the objects recorded in the basic level.
High

Records mouse over, mouse down, and double-click events on objects with handlers or behaviors attached, in addition to the objects recorded in the basic level.

10.3.1 To set Web Event Recording Configuration:

Choose Tools > Web Event Recording Configuration.
The Web Event Recording Configuration dialog box opens. Use the slider to select your preferred standard event-recording configuration.

Click OK.

No comments: