Tuesday, 21 August 2012

How to record a script in QTP?

This article explains the steps to be followed to record a script in QTP. Recording script in QTP is very useful for the beginners. We have to follow a certain steps to record a script.

01.Launch the QTP tool.
02.Click on Record button or Press F3 on QTP tool and observe that a pop up window is opened. This window will be opened automatically whenever the "Record" button is pressed.
03.Observe that the pop up window is opened with "Record and Run Settings" tab for each environment based on the add in configured/selected.
  Assume that we have Oracle, SAP add ins are configured along with the default Windows and Web environments.So, the pop up will be opened with Record and Run Settings tabs for Web,Windows, Oracle and SAP environments provided that the add ins are loaded when QTP launched.
04.For any environment the record and run settings are classified into two generic groups.

  • Record and Run on ANY window belonging to the particular environment.
  • Record and Run on a SPECIFIC window belonging to the particular environment. This option is recommended.
05. QTP will remember the settings for the entire record session until the record settings are manually changed by the Automation Engineer.
06.Click on "OK" button and observe that the disclaimer is updated as "Recording" in right bottom of the QTP tool bar.
07. Then launch the application to which the script to be recorded.Perform some action on the application and observe that the script is recorded in the form of VBScript in Expert View and in the form of Object Tables in Keyword view.
08.Once the action is performed on the Application just press on "Stop" or "F4" button and observe that the script recording is stopped.
09.Then Save the script.
10.Playback and check the script to make sure that the script is rerunning without any issue.

Back To Top