Recording a Test
As you navigate through your Web site or application, QuickTest records
your steps. These operations are the basis of your test. When you stop
recording, you can see the steps of your newly-created test in a graphical
format in the Keyword View.
In this lesson you will learn about:
➤ Preparing to Record a Test
➤ Recording a Test
➤ Analyzing the Test in the Keyword View
Preparing to Record a Test
Before you begin recording a test, ensure that both your application or Web
site and QuickTest are set to match the needs of your test.
For the purposes of this tutorial, ensure that:
➤ You have registered as a user in the Mercury Tours Web site. For more
information, see “Using the Mercury Tours Web Site for the First Time” on
page 7.
➤ If you are using Internet Explorer as your browser, the AutoComplete option
is cleared for user names and passwords. For instructions, see “Optimizing
Browser Settings for Your Test” on page 7.
➤ All browsers are closed before you begin recording.
As you navigate through your Web site or application, QuickTest records
your steps. These operations are the basis of your test. When you stop
recording, you can see the steps of your newly-created test in a graphical
format in the Keyword View.
In this lesson you will learn about:
➤ Preparing to Record a Test
➤ Recording a Test
➤ Analyzing the Test in the Keyword View
Preparing to Record a Test
Before you begin recording a test, ensure that both your application or Web
site and QuickTest are set to match the needs of your test.
For the purposes of this tutorial, ensure that:
➤ You have registered as a user in the Mercury Tours Web site. For more
information, see “Using the Mercury Tours Web Site for the First Time” on
page 7.
➤ If you are using Internet Explorer as your browser, the AutoComplete option
is cleared for user names and passwords. For instructions, see “Optimizing
Browser Settings for Your Test” on page 7.
➤ All browsers are closed before you begin recording.
2 Start recording on the Mercury Tours Web site.
Choose Test > Record or click the Record button. The Record and Run
Settings dialog box opens.
➤ In the Web tab, select Open the following browser when a record or run
session begins.
Choose a browser from the Type list and confirm that the URL in the
Address box is http://newtours.mercuryinteractive.com.
Confirm that Close the browser when the test closes and Do not record
and run on browsers that are already open are selected.
➤ In the Windows Applications tab, confirm that Record and run on these
applications (opened on session start) is selected, and that there are no
applications listed.
This
setting prevents you from inadvertently recording operations
performed on various Windows applications (such as e-mail) during a
recording session.
Click OK.
QuickTest begins recording, and your browser opens to the Mercury Tours
Web site.
3 Log in to the Mercury Tours Web site.
In the User Name and Password boxes, type the name and password you
registered with Mercury Tours.
Click Sign-In.
The Flight Finder page opens.
4 Enter flight details.
Change the following selections:
➤ Departing From: New York
➤ On: Dec 29
➤ Arriving In: San Francisco
➤ Returning: Dec 31
➤ Service Class: Business class
Click CONTINUE to accept the other default selections. The Select Flight
page opens.
Notes:
When selecting the date, you must click on the drop-down list, scroll to any
entry that is not showing, and select it. This is because QuickTest only
records a step if the value in the list changes. The tutorial will not work
correctly if you accept the currently displayed month or day.
When entering dates while recording this test, do not click the View
Calendar button, which opens a Java-based calendar. Your test will not
record the date selected using this calendar because the Java Add-in is not
loaded for this tutorial (The Java Add-in is an external add-in that can be
purchased separately.)
To check which add-ins are loaded, click Help > About QuickTest
Professional. To change the available add-ins for your tests, you must close
and reopen QuickTest Professional.
5 Select a flight.
Click CONTINUE to accept the default flight selections. The Book a Flight
page opens.
6 Enter required passenger and purchase information.
Enter the required information (fields with red text labels) in the Passengers
and Credit Card sections. (You may enter fictitious information
In the Billing Address section, select Ticketless Travel.
At the bottom of the page, click SECURE PURCHASE. The Flight
Confirmation page opens.
7 Review and complete your booking.
Click BACK TO HOME. The Mercury Tours home page opens.
8 Stop recording.
In QuickTest, click Stop on the Testing toolbar to stop the recording process.
You have now reserved an imaginary business class ticket from New York to
San Francisco. QuickTest recorded your Web browser operations from the
time you clicked the Record button until you clicked the Stop button.
9 Save your test.
Select File > Save or click the Save button. The Save dialog box opens to the
Tests folder.
Create a folder named Tutorial, select it, and click Open.
Type Recording in the File name field.
Confirm that Save Active Screen files is selected.
Click Save. The test name (Recording) is displayed in the title bar of the
main QuickTest window.
Analyzing the Test in the Keyword View
As you recorded your test, QuickTest generated steps in the Keyword View
representing each operation you performed in the Web browser.
The columns in the Keyword View show different information for each step,
as follows:
➤ Item—Displays the item for the step (test object, utility object, function call,
or statement) in a hierarchical icon-based tree.
➤ Operation—The operation to be performed on the item, for example, Click
or Select.
➤ Value—The argument values for the selected operation, for example, the
mouse button to use when clicking the image.
➤ Assignment—The assignment of a value to or from a variable so you can use
the value later in the test.
➤ Comment—Any textual information you want to add regarding the step, for
example, Return to page used in first step of the test.
➤ Documentation—Auto-documentation of what the step does, in an
easy-to-understand sentence, for example, Click the “findFlights” image.
Note: You can choose to hide or display individual columns as required, by
right-clicking the column heading in the Keyword View and selecting a
column name from the list.
In the Item column of the Keyword View, you can click the branch arrows to
expand or collapse the steps under each Web page. You can expand the
entire test by choosing View > Expand All.
For every step performed on an object, QuickTest displays a row in the
Keyword View with an icon and details of the step. For example, the step
below instructs QuickTest to click the reserveFlights image at a specific
location in the Select a Flight: Mercury page of the Mercury Tours Web site.