Record and replay

Recording is a process of capturing human actions performed on AUT and simultaneously creating a script, which can be replayed on AUT many times.

What happens when we record

When a user records the scripts, QTP perform various tasks as shown in following steps:

  1. QTP uses a test object model. It identifies the test object and operation performed on an object that belongs to AUT.
  2. Then it stores the test object in a local object repository on which the user performed the action.
  3. Object identification properties of the test object are captured, which allows identification of the object uniquely at time of replay.
  4. It provides a logical name to a test object, which makes objects' names readable.
  5. Create a test step; a test step contains test objects including parent(s), operation, and data, if applicable. The following code is an example of the test step:
Dialog("Login").WinEdit("Agent Name:").Set "ashish"

In the previous test step, Dialog is the class name, Login is its logical name, and it is a parent of the WinEdit object. WinEdit is the class and Set is the operation, which sets the value as ashish to the object whose logical name is Agent Name:

The steps for recording are as follows:

  1. Click on the Record button on the toolbar as shown in the following screenshot:
    What happens when we record
  2. Perform the action on the AUT.
  3. Repeat step 2 to record other test steps.

What happens when we replay

When QTP replays the scripts, it performs various tasks as shown in the following steps:

  1. QTP finds the test object.
  2. It identifies the test object uniquely; in some cases it may be using one of the following items: ordinal identifiers, smart identification, and relational identifiers.
  3. Perform the intended operation on the runtime object.

The steps for recording are as follows:

Click on the Run button in the toolbar as shown in the following screenshot:

What happens when we replay
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.186.92