You are on page 1of 24

QTP Training

2008, Cognizant Technology Solutions. All Rights Reserved. The information contained herein is subject to change without notice.

Testing Services

Create a Test

Objectives
After completing this chapter, you will be able to:

Create a basic test from a manual test case. Run a test and check for errors.

Store the test file.


Define and plan for initial and end conditions in test creation.

QuickTest Professional Workflow


1
Prepare Create

3
Verify & Enhance

4
Integrate

Setup for test automation

Create basic test Record user actions Confirm successful playback Use Object Repository

Enhance basic test Add synchronization Insert checkpoints Data drive the test

Integrate tests

Document manual test steps Check applications/ environment stability Check that data is valid

Pass data
Build integrated test sets

Figure 3-1 Step 2 of Workflow Create Tests

QuickTest Professional Workflow


Once you have outlined your test plan, isolated test requirements, and determined where to locate data, the automation process can begin. We are ready to follow the procedural steps to use QuickTest to automate our business processes.

The User Interface


Title Bar Menu Bar Debug Toolbar Testing Toolbar File Toolbar

Keyword View

Data Table

Active Window

Status Bar

Figure 3-2 QuickTest Professional 8.2 User Interface

The User Interface


The QuickTest Professional user interface is broken up into a number of functional areas. You can choose to focus on one or more areas depending on the task you are performing. The toolbars within the QTP interface are standard Windows toolbars. The options you see may vary.

Record a Test

Figure 3-3 Building Blocks of a Step

Record a Test
Once the RECORD button is pressed and test steps are performed, QuickTest listens and records the activities. This results in the recording and storing of each step of the business process. Each step consists of: - The object - The method (operation) - The method property (a value for the action performed on the object) QuickTest should be running before the application under test is invoked. For some environments, this is mandatory.

Saving Tests

Figure 3- 4 QuickTest Professional SaveAs Dialog

Saving Tests
If you are using QuickTest Professional alone, the file system you will save to is under the QuickTest Professionals Tests directory. You have the option to save the test results along with the test.

Run a Test and Save Results


Step 1

Step 2

Step 3

Figure 3- 5 Save and Run A Test

Run a Test and Save Results


1. From the QTP toolbar, Click on the RUN button.

2.

A best practice is to use the Temporary folder to hold the results while debugging your test.
Press the OK button to execute the Run command.

3.

Viewing the Test Run

Figure 3- 6 Viewing A Test Run

Viewing the Test Run


When you run a test, QuickTest performs each step as it was recorded on the AUT. This requires that the AUT is running before or as the test is executed. You can watch in the AUT as QuickTest performs each step. A yellow arrow in the left margin of the KEYWORD VIEW points out the step currently running. When QuickTest finished running the test, you can open the Test Results window.

Steps To View Results

Figure 3- 7 Test Results Window

Steps To View Results


1. Decide if results must be viewed.

2.
3.

If yes, select TEST RESULTS from the QTP menu bar.


View the outcome of the test run.

4.

Expand the results tree, From the Test Results menu bar, select VIEW EXPAND ALL.

View Test Results

Figure 3- 8 Test Results Summary

View Test Results


Failures roll-up to the parent at the top level of the tree. Expand the Test Results tree to see the outcome of each step. Navigate to the child step that caused the failure.

Review Questions
1. Which application must be started first in order to ensure that QTP will be able to start to automate testing? a) b) c) The application under test. QuickTest Professional. Neither of the above.

2.

When outlining your test steps, what principle is important to implement so a test can be re-used any number of times?

a)
b) c)

Load the appropriate Add-In.


Have all required applications running on the desktop. Set initial and end conditions as part of the test.

3. How can you tell that QTP is in the Record mode?


a) The Keyword View changes. b) The word Recording flashes in the lower right corner of the interface. c) There is no indication.

4. Which tool is available to help analyze the outcome of a test run?


a) b) c) d) The The The The Active Screen. Global data table. test results. Record and Run settings.

Thank you

2008, Cognizant Technology Solutions. All Rights Reserved. The information contained herein is subject to change without notice.

Testing Services

You might also like