Introduction to QuickTest Professional 8.0 - Student Handbook
1 Planning Your Test
Objectives
Exercise: Evaluating a Test Case
Test Case 1
Test Case 1 Review
1. These are some characteristics of a useful test case. Are these characteristics included in Te...
2. List one example of a test objective and two examples of a test requirement.
3. What is the importance of learning the application under test before creating automated test s...
Test Case 1 Review Answers
1. Are these characteristics included in the sample Test Case?
Purpose: Test objective stated.
Navigation: User actions are not included.
Verification: Test requirements listed.
Sample Data: Sample data was not included.
2. List one example of a test objective and two examples of a test requirement.
Objective: Create a new order with the flight reservation application.
Requirement: Verify that insert done appears in the status bar of the flight reservation window.
Requirement: Verify that an order number is displayed in the order number box on the flight reser...
3. You can record a basic test with the correct user actions in a short amount of time.
Exercise: Learning the AUT
Part 1: Create a New Order
1. From the Start menu, select Programs > QuickTest Professional > Sample Applications > Flight. ...
2. Log in using the Agent Name: jojo with a Password: mercury.
3. Click OK. The application will launch the Flight Reservation window as show in Figure11.
Figure 11
4. Enter the following data in the flight reservation fields: date of travel 11/01/10, flying fro...
5. Click the Flights button to display the flight schedule.
6. The first flight on the schedule is highlighted. Click OK to accept this flight and close the ...
7. In the Name field, type your name.
8. In the Class field, choose Business.
9. Click Insert Order. Notice how the application processes your reservation and displays an Inse...
10. Your order number should appear in the bottom right corner of the Flight Reservation window. ...
Part 2: Retrieve an Order
1. From the File menu, select Open > Order. The Open Order screen appears.
2. Put a check in the Order No. field then type your order number.
3. Click OK. Your order appears on your screen.
4. Change the date of travel to tomorrows date.
5. Click Update Order.
Figure 12
Part 3: Delete an Order
1. If your flight reservation order is not displayed on your screen, reopen it from the File menu...
2. Click the Delete Order button.
3. When the delete confirmation message appears, (Figure13) click Yes. Your order is now remove...
Figure 13
2 Recording and Running a Test
Objectives
Exercise: Record and Playback
Part 1: Set-up the Test Environment
1. Open QuickTest Professional from the Start menu. The Add-In Manager appears.
2. Deselect any add-ins that appear in the Add-in Manager. There are no add-ins required for crea...
3. Click OK. QuickTest Professional launch windows open on your screen.
4. Open the Mercury Flight Reservation application. The login window appears.
5. In the Agent Name field type: jojo. In the Password field type: mercury. The Mercury Flight Re...
6. Re-open QuickTest Professional then click File > New Test from the QuickTest menubar.
7. Click Record. The Record and Run Settings window opens (Figure21).
8. Note: Additional environment tabs will appear in this dialog depending on which Add-ins you ha...
Figure 21
9. From the Windows Applications tab select Record and run test on Any Open Windows application.
10. Click OK to return to the main QuickTest window.
Part 2: Record the Test
1. Begin recording user actions by re-displaying the flight reservation screen. (You may need to ...
Figure 22
2. Record the user actions that will create a new flight reservation. Make up your own data or us...
3. Click the Flights button and accept the first flight on the schedule. Click OK.
4. Type your name in the Name field and choose First class.
5. Click Insert Order. Watch to ensure that the message Insert Done...appears in the progress bar...
6. Click New Order button.
7. From the QuickTest menu, click Stop to end the test.
8. Click File > Save to store your test as
_CreateOrder.
Part 3: Run the Test
1. If the test created in Part 2: Record the Test is not already displayed on your screen, find a...
2. Click Run. In the Run Results location tab, (Figure3.) choose the option to save your test re...
Figure 23
3. Open the Mercury Flight Reservations application. The test should automatically begin repeatin...
4. When the test run is complete, the test results will appear on your screen (Figure24).
Figure 24
Test Results Review
1. How many times did your test run?
2. Did your test succeed or fail?
3. Write the command to display all of the steps in the icon view of the test results.
4. Click once on the Agent Name step in the Keyword View. What field is highlighted in the Active...
5. Click once on the Fly To: step in the Keyword View. What happened in the Active Screen when yo...
Test Results Review Answers
1. How many times did your test run?
The test ran one time as indicated by the number of iterations in the summary.
2. Did your test succeed or fail?
The test was designed to succeed. If your test failed, try repeating the steps listed in the lab ...
3. Write the command to display all of the steps in the icon view of the test results.
View > Expand All
4. Click once on the Agent Name step in the Keyword View. What field is highlighted in the Active...
The Agent Name field is highlighted.
5. Click once on the Password step in the Keyword View. What happened in the Active Screen when y...
The same screen appears but the Password field is now highlighted.
3 Understanding Objects in QuickTest
Objectives
Understanding Objects Review
1. Circle each item on this list that represents an object class.
a) Test
b) Data entry
c) Drop-down List
d) Error message
2. The only way to distinguish one object from the other of the same class is by the difference i...
3. After learning the class and properties of an object, QTP assigns a name to the object that is...
a) logical name
b) object class
c) object property
d) value
4. QuickTest Professional stores recorded object properties in the:
a) Object Spy
b) Object Repository
c) Property Value
d) Test Results
Understanding Objects Review Answers
1. The correct answer is Drop-down list. An object is a graphic user element in an application, s...
2. The correct answer is True. Specific characteristics of an object within QuickTest are called ...
3. After learning the class and properties of an object, QTP assigns a name to the object. This i...
4. Recorded object properties are stored in QTPs Object Repository.
Exercise: Identifying Objects
Part 1: Create a new test
1. Open QuickTest Professional.
2. Open the Mercury Flight application. StartÆ ProgramsÆ QuickTest ProfessionalÆ Sample Applicati...
3. Login using the following information: Agent Name: jojo Password: mercury. The Flight Reservat...
4. From the QuickTest toolbar, click the Record button. The Record and Run Settings window should...
5. Choose Record on any open Windows-based application then click OK. Recording appears in red in...
6. Re-display the Flight Reservation window (minimized in your taskbar) and enter the following f...
7. Click on the Flight button then click OK to accept the first flight schedule.
8. Enter the following personal data: Name: Sam Smith, No. of Tickets: 2, Seating: First Class.
9. Click Insert Order.
10. When Insert Done...appears in the progress bar, click the New Order button to clear the data ...
11. Click Stop to end the test.
Part 2: Save the Test
1. Choose File >Save.
2. Save the test as
_ObjectReview.
3. Click Save. As shown in Figure31, the name of the test now appears in the title of the Quick...
Figure 31
Part 3: Run the Test
1. From the QuickTest menu bar, click .
2. Click OK to use the Temporary Test Results directory for this test run.
3. Observe playback of the test.
4. This test was designed to succeed. If your test fails, open the Test Results to analyze and re...
Figure 32
Test Objects Review
1. How many objects can you identify?
2. How many different classes of objects can you identify?
3. How many objects of the class Button are shown?
Test Objects Review Answers
10 - Flight reservation, date of flight, tickets, name, flyfrom, flyto, insert order, flight, but...
4. How many different classes of objects can you identify?
7 - window, winbutton, winobject, winedit, winobject, wincombobox, and dialog.
5. How many objects of the class Button are shown?
4 - insert order, flight, button, and OK.
Exercise: Changing the Object Name
1. In the Keyword View, use your mouse to highlight the last step in the test as shown in Figure...
Figure 33
2. Notice that the name of the object is Button and the documentation column describes the action...
3. Select Object Properties from the step menu.
4. Click the Repository button on the Object Properties window.
5. Right-click on the Button object to open the menu (Figure34).
Figure 34
6. Type a new name that describes the button such as New Order.
7. Click Enter or click OK twice to save the change and close the object repository window.
Figure 35
4 Creating Synchronization Steps
Objectives
Synchronization Review
1. Circle each function that synchronization performs in a test.
2. Synchronization is enabled only during recording.
3. Write the command to insert a synchronization point in a test.
4. Circle each application object that might require synchronization.
5. Open the test called synch_example from the directory Ch04_synch_example in C:\MTesting....
Synchronization Review Answers
1. Circle each function that synchronization performs in a test.
The correct answer is: Provides time for an object to process before moving on to the next step.
2. Synchronization is enabled only during recording.
The correct answer is - TRUE.
3. Write the command to insert a synchronization point in a test.
Insert > Step > Synchronization Point
4. Circle each application object that might require synchronization.
The correct answer is: Insert Button and Popup Message.
5. The synchronization point in the Synch_Example test is named Insert Done Text (Figure41).
Figure 41
Exercise: Analyzing a Failed Test
1. From QuickTest Professional, open the test called Create_Order.
2. Launch the Flight Reservation application but do not log in. This test begins with a log in sc...
3. Click Run to playback the test.
4. Save the test results to a temporary directory.
5. Review the test summary by clicking Test > Results. The test should have succeeded without any...
6. Close the Test Results window. The Create_Order test should be displayed on your screen.
7. Click Test > Settings to open the Test Settings window.
8. Click the Run tab and change the Object Synchronization Timeout value from 20000 to 5000 milli...
Figure 42
9. Run the test again. The test should have failed because the objects in the application were no...
Figure 43
Exercise: Inserting a Synchronization Point
1. Open QuickTest Professional.
2. Open the Mercury Flight Reservation application.
3. Log in to the Flight Reservation application as Agent Name: jojo Password: mercury. The Flight...
4. Click Record to start the test. Record user actions to create a new flight reservation. Make u...
5. Click the Flights button and accept the first flight on the schedule. Click OK.
6. Type your name in the Name field and choose First class.
7. Click Insert Order. At this point, you want to make sure QuickTest waits for the order to proc...
Figure 44
8. From the QTP menu bar, select Insert >Step > Synchronization Point. The cursor becomes a point...
9. Click on the words Insert Done... in the progress bar with the pointed finger.
10. In the Object Selection-Synchronization Point window, click OK. The Add Synchronization Point...
Figure 45
11. Type the word: text in the Property Value field. Keep the default timeout of 10000 milliseconds.
12. Click OK to close the synchronization window.
13. Finish the test by selecting File > New Order to reset the initial condition.
14. Click Run to replay your test.
15. View the test results to ensure that your test was executed successfully.
5 Using Standard Checkpoints
Objectives
Checkpoints Review
1. What is the function of a checkpoint in QuickTest?
2. Where is the status of a checkpoint (passed or failed) located?
3. What causes a checkpoint to fail?
Checkpoints Review Answers
1. A checkpoint is a specialized step in QuickTest that compares two values and reports the result.
2. The status of a checkpoint (passed or failed) is located in the Test Results Summary.
3. If the two values match, the checkpoint passes; if not, the checkpoint fails.
Exercise: Add a Standard Checkpoint
Part 1: Create a New Test and Checkpoint
1. Open QuickTest Professional.
2. Open the Mercury Flight application. StartÆ ProgramsÆ QuickTest ProfessionalÆ Sample Applicati...
3. Login using the following information: Agent Name: jojo Password: mercury. The Flight Reservat...
4. Click Record to start the test. Record user actions to create a new flight reservation. Make u...
5. Click the Flights button then click OK to accept the first flight schedule.
6. Type your name in the Name field and choose First class.
7. Click Insert Order. Your verification that the order has been inserted correctly is when the t...
Figure 51
8. From the QTP menu bar, select Insert >Checkpoint > Standard Checkpoint. The cursor becomes a p...
9. Click on the words Insert Done... in the progress bar with the pointed finger.
10. In the Object Selection-Checkpoint Properties window, click OK. The Checkpoint Properties win...
Figure 52
11. The property you want to use as a verification is the text Insert Done...Deselect all other c...
12. Click OK to close the Checkpoint Properties window.
13. In the Flight Reservation application, click File > New Order to set the end condition of the...
14. Stop the test.
15. Save the test.
Test Results Review
1. Did your test pass or fail? Where did you locate this information?
2. Did your checkpoint pass or fail? Where did you locate this information?
3. Display the details of your checkpoint step. What command did you use to perform this task?
Test Results Review Answers
1. This test was designed to run successfully. The word Passed should appear in green text in the...
Figure 53
2. This checkpoint was designed to run successfully. Double-click the checkpoint step to display ...
Figure 54
6 Adding Parameters
Objectives
Parameter Types Review
1. Draw a line to connect the parameter type in the left column to the appropriate usage in the r...
Parameter Type
Usage
Random Number
Insert a number generated earlier in the test run into the Order Number field each time the test ...
Data Table - Input
Insert a different department code into the Department Number field each time the test runs.
Environment
Insert an action from a business process test in Mercury Quality Center.
Data Table - Output
Insert a number from 1-10 into the Number of Orders field each time the test runs.
Component
Insert the server name into the Host ID field each time the test is run.
Table 61.
2. A data-driven test performs the following functions: (circle all that apply).
a) Runs multiple test iterations using different input values.
b) Uses a database to create a new test.
c) Connects multiple test runs.
d) Reports new data for a test.
3. List the differences between the Design-Time data table and the Run-Time data table.
Parameter Types Review Answers
1.
Parameter Type
Usage
Random Number
Insert a number from 1-10 into the Number of Orders field each time the test runs.
Data Table - Input
Insert a different department code into the Department Number field each time the test runs.
Environment
Insert the server name into the Host ID field each time the test is run.
Data Table - Output
Insert a number generated earlier in the test run into the Order Number field each time the test ...
Component
Insert an action from a business process test in Mercury Quality Center.
2. A data-driven test runs multiple test iterations using different input values.
3. Some differences include:
Design-Time Data Table:
Run Time Data Table:
Viewed in the main QuickTest window
Viewed in the Test Results window
Created prior to the execution of the test.
Generated after a test is executed.
Represents data from an external source.
Represents a live version of the Design-Time table after the test run.
Exercise: Create and Run a Test
Part 1: Create a New Test and Checkpoint
1. Open QuickTest Professional.
2. Open the Mercury Flight application. StartÆ ProgramsÆ QuickTest ProfessionalÆ Sample Applicati...
3. Login using the following information: Agent Name: jojo Password: mercury. The Flight Reservat...
4. Click Record to start the test. Record user actions to create a new flight reservation. Make u...
5. Click the Flights button then click OK to accept the first flight schedule.
6. Type your name in the Name field and choose First class.
7. Click Insert Order. Wait until Insert Done...appears in the progress bar as illustrated in Fig...
Figure 61
8. In QuickTest Pro insert a synchronization point on the Insert Order step:
a) In QuickTest Pro select Insert > Step > Synchronization Point. Your cursor changes to a pointi...
b) Single-click on the Insert Done...text in the progress bar on the Flights window. The Object S...
c) Verify that WinObject: Insert Done is selected, then click OK. The Add Synchronization Point w...
d) In the Property Type field, choose text.
e) In the Property Value field, type Insert Done... including the quotation marks and the dots.
f) Click OK. The Insert Done step now appears as a synchronization point in your test (Figure62).
Figure 62
9. Insert a checkpoint to validate the Order Number number field:
a) Click Insert > Checkpoint > Standard Checkpoint. The cursor changes to a pointing hand.
b) Single-click on the Order Number field on the Flights window.
c) Make sure that WinEdit: Order No. is highlighted in the Object Selection window, then click OK...
d) Make sure that only the Enabled field has a checkmark, then click OK. The Checkpoint is insert...
10. In the Windows Mercury Flight Application click File > Open Order.
11. Check the box next to the Order No. field.
12. Type the order number of the reservation you just created. The order should reappear on your ...
13. Change the number of tickets from 1 to 2.
14. Click Update Order.
15. Click File > New Order to reset the original conditions of the test.
16. Click Stop to end the recording.
Part 2: Run the Test and Analyze the Error
1. Click Run. Your test should encounter an error as illustrated in Figure63.
Figure 63
Exercise: Create an Output Parameter
Part 1: Capture an Output Value
1. Highlight the step Order Number step in the Keyword View. This is the step that was created du...
2. Move your cursor to the Active Screen (lower right) and right-click on the ORDER NO. field
3. Choose INSERT OUTPUT VALUE from the ORDER NO. field menu. The OBJECT SELECTION -OUTPUT VALUE P...
4. Make sure that WINEDIT: ORDER NO. is highlighted then click OK. The OUTPUT VALUE PROPERTIES wi...
5. Check the box next to TEXT.
6. Select the radio button for AFTER CURRENT STEP located at the bottom of the OUTPUT VALUE PROPE...
7. Click OK to close the properties window. A column called ORDER_NO_TEXT_OUT should appear in th...
Figure 64
Part 2: Run the Test and Analyze the Error
1. Click Run. Your test should encounter an error and fail.
2. Can you determine why your test is continuing to fail?
Part 3: Create an Input Parameter
1. Highlight the Edit step under the parent step titled Open Order then click once in the Value c...
2. Click the parameter icon <#> to open the Value Configuration Options window.
3. Click the Parameter radio button and select Data Table from the drop-down list. Make sure that...
Figure 65
4. Click OK.
5. Save the test as
_parameter_example.
Part 4: Run the Test and Celebrate your Success
1. Click Run. Your test should succeed.
7 Recovery Manager
Objectives
Recovery Manager Review
1. List four types of trigger events that would interrupt your test run.
2. Define the term Recovery Operation.
3. List one example of a Post-Recovery Test Run option.
Recovery Manager Review Answers
1. A checkpoint is a specialized step in QuickTest that compares two values and reports the result.
2. The status of a checkpoint (passed or failed) is located in the Test Results Summary.
3. A post-recovery test run option is how QuickTest should proceed once the recovery operations h...
Exercise: Parameterized Test
Part 1: Create a New Test
1. Open QuickTest Professional.
2. Click Record on the QuickTest Professional menu bar.The Record and Run Settings window opens. ...
3. Open the Mercury Flight application. StartÆ ProgramsÆ QuickTest ProfessionalÆ Sample Applicati...
4. Login using the following information: Agent Name: jojo Password: mercury. The Flight Reservat...
5. Click File > Exit to close the Flight application.
6. Click Stop on the QuickTest Professional menu bar.
Figure 71
Part 2: Add a Data Table Parameter
1. Highlight the Agent Name step then click once in the Value column.
2. Click the parameter icon <#> to open the Value Configuration Options window.
3. Click the Parameter radio button and select Data Table from the drop-down list.
4. Type a description for the input parameters, such as Login_Names, in the Name field.
5. Click OK. The heading you created should appear in the first data table column.
6. Add the following 5 names to your data table: bob32, bob0404, bob, bobsmith, bsmith. A similar...
Figure 72
7. Click the Save icon to retain the changes to your test.
Exercise: Recovery Scenario
Part 1: Create a Recovery Scenario
1. If the test you created is not already displayed on your screen, find and open it by clicking ...
2. Click Run. In the Run Results location tab, choose the option to save your test results to a t...
3. Your test should fail during the third iteration. What error message appeared that stopped the...
4. To anticipate and correct this error, click Tools > Recovery Scenario from the QuickTest menu ...
5. Click the New Scenario wizard icon as shown in Figure73. The Recovery scenario wizard opens.
Figure 73
6. Review the information on the Welcome screen then click Next.
7. Select the trigger event that caused the error (Pop-up window), then click Next.
8. To identify the name of the window where the error message appears, click the Pointing Hand ic...
9. Move the Pointing Hand to the application popup error window then click once. The name of the ...
Figure 74
10. Click Next to continue.The Recovery screen appears.
11. You do not need to make any additions to this screen. Click Next. The Recovery Operation scre...
12. Choose the operation type: Keyboard or mouse operation. Click Next.
13. Choose the radio button: Click button with label:.
14. Click on the pointing hand to activate it.
15. With the pointing hand click on the OK button in the application popup error window.
16. Click Next. The Recovery Operations screen opens.
17. De-select the option to Add another recovery scenario then click Next.
18. In the Test Options list, choose the Proceed to next step radio button. This enables the test...
19. Type a name for your scenario. Click Next. The Finish screen opens.
20. Check the box to Add scenario to current test. Click Finish. The name of your scenario should...
Figure 75
21. Click the Save icon on the Recovery Manager window to store the scenario you created as a .qr...
22. Click Close.
23. Stop the test run.
Part 2: Run the Test and Analyze the Results
Part 3: Create a Second Recovery Scenario
1. If the test you created is not already displayed on your screen, find and open it by clicking ...
2. Click Run. In the Run Results location tab, choose the option to save your test results to a t...
3. Your test should fail during the third iteration. What error message appeared that stopped the...
4. To anticipate and correct this error, click Tools > Recovery Scenario from the QuickTest menu ...
5. Click the New Scenario wizard icon. Review the information on the Welcome screen then click Next.
6. Select the trigger event that caused the error (Popup window), then click Next.
7. To identify the name of the window where the error message appears, click the Pointing Hand ic...
1. Move the Pointing Hand to the application login window then click once. The name of the window...
2. Click Next to continue.The Recovery screen appears.
3. You do not need to make any additions to this screen. Click Next. The second recovery scenario...
4. Define the action that QuickTest should take if this error occurs during a test run by clickin...
5. Move the Pointing Hand to the application window then click once on the Cancel button. The nam...
6. Click Next. The Recovery Operations screen opens.
7. De-select the option to add another recovery scenario then click Next.
8. In the Test Options list, choose Proceed to the next step. This enables the test to move to th...
9. Type a new name for this second scenario. Click Next. The Finish screen opens.
10. Check the box to Add scenario to current test. Click Finish.
Part 4: Check the Test Settings and Run the Test
1. To make sure that both scenarios are linked to your test, click Test > Settings from the Quick...
2. Click the Recovery tab.
3. Check to make sure that two scenarios appear in the Recovery tab as shown in Figure76. Use t...
Figure 76
4. Click OK.
5. Click Run to playback the test. The test should succeed.