Flight Reservation Application in HP UFT/QTP

โšก Smart Summary

Flight Reservation Application is the sample desktop program bundled with every HP UFT/QTP installation, used throughout hands-on exercises to practice login, flight search, booking, and VBScript automation without needing a live web application.

  • ๐Ÿ›ซ Purpose: Flight Reservation is the offline Win32 sample application shipped with UFT/QTP for hands-on practice.
  • ๐Ÿ”‘ Login: Enter any agent name of four or more characters plus the fixed password mercury to open the main window.
  • ๐ŸชŸ Main window: Fly From, Fly To, date, and Insert Order fields drive every booking, modification, and deletion.
  • ๐Ÿงฐ Object types: WinEdit, WinComboBox, WinButton, WinList, and one ActiveX MaskEdBox cover most standard UFT test object classes.
  • ๐Ÿค– Automation: SystemUtil.Run launches the executable, then Dialog and Window calls script the login and search flow.
  • ๐Ÿ“Š Reporting: The built-in Reports and Graphs section tracks ticket-selling trends without extra setup.
  • ๐Ÿš€ Reuse: Pre-populated bookings let testers skip data setup and jump straight into checkpoints and regression runs.

What Is the Flight Reservation Application in UFT/QTP?

The Flight Reservation Application is the sample desktop program that ships with every installation of HP UFT/QTP. This article introduces the application so that the rest of the hands-on exercises in the QTP series have a stable, offline target to record and run tests against. Because it never changes shape between UFT releases, beginners can follow along on almost any supported version without their steps drifting out of sync with the screenshots.

Flight Reservation Application

The screenshot above shows the Login dialog that appears the moment the executable starts. Using Flight Reservation, you can book a flight between two cities, and later modify or delete an existing booking, all without needing an internet connection or a live server.

Flight Reservation Application

The second screenshot shows the main Flight Reservation window after a search, listing matching flights with their fare and schedule. You may also fax a booking to a customer with a custom signature, and the Reports and Graphs section helps analyze ticket-selling trends over time.

Every new agent account starts with a small number of bookings already populated, so you do not have to create test data before you begin recording. The application has been designed to help learn all the features provided by Micro Focus UFT. At times you may find this application buggy, but the focus should not be the technical accuracy of the application – it exists purely as a tool to learn various features of QTP.

Guru99’s separate web-based Mercury Tours exercises use a different sample – the online newtours.demoaut.com site – so do not confuse the two. Flight Reservation is the desktop Win32 application described on this page, launched locally rather than opened in a browser, and it is the target used across the standard-Windows-object lessons in this QTP series.

Click here if the video is not accessible

How to Launch, Log In, and Automate the Flight Reservation Application

Before recording anything in UFT, get comfortable operating Flight Reservation manually. The application lives inside the QTP/UFT installation folder and starts like any other Windows executable.

  1. Browse to C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\ and double-click flight4a.exe (the exact path varies slightly by UFT version).
  2. The Login dialog opens first. Type any agent name that is at least four alphanumeric characters, such as guru99, into the Agent Name field.
  3. Type mercury into the Password field – this fixed password is hard-coded into the sample application and never changes.
  4. Click OK. The main Flight Reservation window opens, ready for a new order.

Before recording, confirm that the UFT Add-in Manager loads only the Standard Windows and ActiveX add-ins. Loading the Web add-in as well can slow the recorder down and is unnecessary, since Flight Reservation is a desktop target rather than a browser page.

Once you can log in by hand, the next step is to reproduce the same actions in a UFT script so the login becomes repeatable. The snippet below launches the executable, signs in, searches a route, and inserts an order using the same object names UFT assigns when you record the flow.

' Launch the Flight Reservation application
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"

' Log in with an agent name and the fixed password
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "guru99"
Dialog("Login").WinEdit("Password:").Set "mercury"
Dialog("Login").WinButton("OK").Click

' Search for a flight between two cities
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click

' Pick the first available flight and confirm the order
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select 0
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Guru99 Tester"
Window("Flight Reservation").WinButton("Insert Order").Click

' Close the application
Window("Flight Reservation").Close

Save this as an action inside a new UFT test, run it once, and confirm the Flight Reservation window closes without a runtime error. Once the base flow is reliable, replace the fixed strings with VBScript variables or a data table row so the same script can search many routes.

โš  Tip: If UFT does not recognize the Login dialog when you start recording, open Record and Run Settings and confirm only the Windows Applications tab is configured, then close and restart Flight Reservation before trying again.

Key Windows and Fields in the Flight Reservation Application

Flight Reservation exposes a small, well-defined set of windows. Knowing their names in advance makes it much easier to read a recorded UFT script or to build one with descriptive programming, and it saves time when you are troubleshooting a failed step in the Keyword View.

Window / Dialog Purpose Key Fields or Controls
Login Authenticates the agent before the main window opens Agent Name, Password, OK, Cancel
Flight Reservation (main window) Searches, books, and manages flight orders Fly From, Fly To, date, Trip Type, FLIGHT, Insert Order, Delete Order
Flights Table Lists matching flights returned by a search From list (flight number, times, fare), OK, Cancel
Fax Order Faxes a confirmed booking with an optional signature Fax Number, Send Signature With Order, Send
Open Order / Delete Order Retrieves or removes an existing booking by order number Order No., Customer Name, OK
Reports and Graphs Summarizes ticket-selling trends for the agent Report type, date range, Print

Most controls in the main window are standard Windows objects – WinEdit, WinComboBox, WinButton, and WinList – while the flight-date field is an ActiveX MaskEdBox, which is why it needs its own Type call instead of Set.

Each dialog keeps the same control names release after release, so a script that references Window("Flight Reservation").WinComboBox("Fly From:") in one UFT version keeps working after an upgrade, which is unusual for most real-world applications under test and is one reason the sample stays useful for years of practice.

Why the Flight Reservation Application Is Used for UFT Practice

Guru99’s QTP series returns to Flight Reservation in almost every later exercise, and there are practical reasons for that choice rather than mere convenience.

  • It ships inside every UFT/QTP installation, so there is nothing extra to download or license before you start practicing.
  • It runs entirely offline, which removes flaky network calls as a source of test failures while you are still learning the tool.
  • Its windows cover most of the standard Windows object types – WinEdit, WinButton, WinComboBox, WinList, WinMenu, WinCheckBox, and an ActiveX control – in a single, small application.
  • Pre-populated bookings mean you can practice object identification, checkpoints, and regression runs without first creating your own test data.
  • Because the interface rarely changes between UFT versions, scripts recorded years ago against Flight Reservation still run correctly today.
  • Guru99’s other QTP tutorials reuse the same window and field names shown in the table above, so lessons stay consistent as you move from one article to the next.

These same properties make Flight Reservation a reasonable sandbox for practicing descriptive programming and building a shared object repository before you move on to testing a real, browser-based application under test. Once checkpoints, regression runs, and the object repository feel comfortable here, the same UFT skills transfer directly to production web and desktop applications.

FAQs

The password is always mercury, in lowercase, regardless of which agent name you type. The Agent Name field itself accepts any string of at least four alphanumeric characters, so testers commonly type a name such as guru99.

It sits inside the UFT/QTP installation folder, typically at C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe. The exact drive letter and folder name can vary slightly between UFT versions and custom install paths.

Yes. Because it ships with the UFT/QTP installer, repairing or reinstalling UFT restores the original executable and sample data. Deleting locally created bookings does not require reinstalling the whole application.

AI-assisted UFT features can suggest steps and self-heal broken locators, but Flight Reservation’s dialogs are simple enough that most testers still write the short VBScript shown above by hand or by recording.

It can. Self-healing object identification re-matches a renamed WinEdit or WinButton control automatically, which reduces script breakage between UFT versions, though testers should still review every healed identifier before trusting it.

Summarize this post with: