Basic QTP Training: Enhancing our script

The past couple of days of our QTP training covered a lot more ground. The most nifty stuff are on tools like the Object Repository, the Object Spy (which is an icon of a guy with a top hat reminding me of Professor Layton), the Active Screen, and the topics on parameterization. I created a short video covering the last 2 topics. So there I demonstrate two things:

  • Updating the script with the help of Active Screen — instead of having to record all over again
  • Updating the script to make use of parameters instead of the hard-coded values.

Basic QTP Training: Creating our first script

For our Application Under Test (AUT), we made use of the sample application called “Flight” which was bundled with QTP.  We were given the test script that we had to automate. Essentially, the script involved:
1. Logging in
2. Creating an Order
3. Faxing an Order
4. Logging out

To accomplish this, here are the basic steps:
(1) Create a new test by selecting File -> New -> Test from the menu (or CTRL+N).
(2) Update the Record and Run Settings by selecting Automation -> Record and Run Settings… from the menu. We needed to add our AUT in the list of Applications.
(3) Create the script — including steps, checkpoints and output values.

You can try recording the steps and it will be able to produce a script.  However, playing it back will fail due to some hard-coded items that are no longer applicable upon rerunning (e.g., window title included the Order Number which would be different in the next run). It also wouldn’t have the needed checkpoints (or the test/assertions) and it wouldn’t gather output data.

For the first script created, QTP’s record function was used to record the steps. Inserting checkpoints and output values were also done during the recording. For instances wherein the object title or text being checked is dynamic (e.g., window title containing the Order Number), we made use of regular expressions e.g., instead of “Flight No. 19” as originally recorded, we made use of “Flight No.*” with the regular expressions checkbox marked.

Here’s a link to a video recording of the script creation:

Alternatively, here’s a similar script creation video without step 3 though, but it does have audio. It covers basic recording and inserting checkpoints and an output value.

Basic QTP Training: Setup

Earlier today was Day 1 of a 5-day Basic QTP Training that I’m attending at work.  Putting my notes here just in case I have to relearn or I have to echo the training. So initially, we did some setup (see details below), and then there was a demo where a manual test case was automated (will post this separately).

Install HP QuickTest Professional

This involved an installer that was nearly 4GB in size. The setup with the wizard was pretty straightforward. After installing, additional configuration included specifying the license and going to Tools -> Options to modify the Run settings such that the “Allow other HP products to run tests and components” checkbox is marked. This is probably since we’re integrating with HP ALM.

Set up ALM integration

QTP can manage to work on its own, but since we plan to be working with ALM for storing and managing the tests we had to install the following items:

  • ALM Explorer (ALMExplorerAddIn.msi, alternative to viewing ALM in IE)
  • HP Quality Center Connectivity (TDConnect.exe, an ALM add-in)
  • QTP for Business Process Testing (Quick-Test_Add-in_for_ALM-QC.msi)