Saturday, November 28, 2009

6. Recording QTP script:

QTP allows you to record our manual operations in three types of modes-General recording, Analog Recording, Low Level Recording. Generally, the automation test creation starts with recording. In this phase, QTP creates executable statements in VB script, which are equal to our manual actions on build.

6.1. What are the modes of recording?

There are there modes

a.) General Recording.

b.) Low Level.

c.) Analog.

a. General Recording:

To record mouse and keyboard operations with respect to objects and windows in our application build, like context sensitive mode in win runner, we can use the general recording mode in QTP. To select this mode, follow one of the following procedures.

§ Click record button in Testing Toolbar.

§ Automation Menu>Record.

§ Shortcut key F3.

b. Analog Recording mode:

In this mode QTP records the mouse movements and key strokes on the keyboard as tracks so that it can help you in testing the situations like signature scanning or handwriting or drawing some objects on the screen or in a window etc. To select analog Recording, follow these options.

§ Automation Menu>Analog Recording.

§ Shift+Alt+F3.

c. Low level recording:

To record mouse pointer movements on the desktop along with time, we can use low level recording, e.g., time-Based operations. To select this mode, perform one of the options.

§ Automation menu>Low Level recording.

§ Ctrl+Shift+F3.

The analog and low level recording modes can be selected only after hitting the record button. In the picture below the first icon is for analog recording and the second one is for low level recording.

Analog and low level recording modes can only be selected after starting to record and going to the automation menu.

6.2. Playback of QTP scripts:

A. What are the modes of running test in qtp and what do they mean?

There are three modes of replaying the test. These are not listed on the toolbar.

When we hit the run button we get the “run” dialogue box, which gives us two options.

1. To save the results in new run results folder. This is the verify mode.

2. To save the result in temporary run result s folder overwriting the earlier results. This is the debug mode.

3. When we need to run the test to update the checkpoints go to “automation” menu and select “update run mode”.

a. Verify mode:

If the test engineer wants to save the results of the test run to compare any verify with the future runs of the same test he would go with the verify mode.

b. Debug mode:

If the test engineer does not want to save the results as he is yet to finish the script or he is testing his QTP coding logic he would run the test in the debug mode.

c. Update mode:

If a test engineer wants to update the expected results while running the test, say for example while recording the script the calendar date was 1020/2008 and while executing the test it is a different date(system date), then the test should be run in the update mode otherwise the test would fail because of the changed properties of the object.

B. Sequence of things happening when the script is played back:

1. QTP’s inbuilt interpreter checks for the syntax errors in the script.

2. It checks to see if the object specified in the script exists in the repository.

3. It checks if the object specified in the script exists on the application under test.

4. Does the action/task specified in the script.

During script execution if any of the above phases encounter the error, then an error window pops up depending on the situation.

No comments:

Post a Comment