Quick Test Professional
Quick Test Professional
Introduction to Automation
Drawbacks of Manual testing - Manual testing is time-consuming and tedious
- Requiring a heavy investment in human resources - Time constraints often make it impossible to manually test every feature thoroughly before the application is released - Low reliability
Manual Testing
Automated Testing
Creating Script(s)
Executing Script(s)
Analyzing Result(s)
Introduction to QTP
QTP
stands Quick Test Professional It is an automated testing tool provided by HP/Mercury Interactive Its a Mercury interactive product.
It is an icon based tool, which automates the functional & regression testing of an application.
Cont..
QTP integrates with other Mercury testing
solutions including: TestDirector/Quality Center WinRunner LoadRunner It is used to test SAP, Web application, Multimedia, mainframe application, etc.
What
is QTP 9.2?
* HP Quick Test Pro 9.2 is a functional automation and regression testing tool
* * *
QTP provides record and playback of events Uses VBScript as the scripting Language
Provides keyword view and expert view to view test cases. * Latest versions of QTP is 9.5 (launched in mid Jan 2008) * Previous version of QTP: 6.5, 8.0, 8.1, 8.2, 9.0, 9.1 * QTP was previously owned by Mercury Interactive
Preparing to record (Planning) Test Environment Test Conditions Recording a session on your application Navigate according to Test Conditions Enhancing your test Adding logic and conditional statements Parameterization Inserting checkpoints
1.
1.
5.
5. 5.
Winrunner Checkpoints - 4 Synchronization - 3 Exception Handling Batch Test Virtual Object Wizard GUI Map Editor GUI Map Configuration GUI Spy
QTP Checkpoints 7 & 3 more Synchronization - 1 Recovery Scenario Manager Test Batch Runner Virtual Object Wizard Object Repository Object Identification Object Spy
1 2 3 4 5 6 7 8
Cont.
9 We used to write the QTP supports the VBS code in WR is TSL and similarly it's like C. We have Two Recording modes. we cannot split the script in winrunner
10 11 12
Three Recording modes (Lowlevel recording) we can divide the script into actions i.e. into logical units
Technologies like SAP, QTP supports different Macromedia, etc, are technologies like SAP not supported. applications, Macromedia applications, PeopleSoft etc
Types of Licenses
Seat
License: A permanent seat license that is specific to the computer on which it is installed.
Concurrent
License: A networkbased concurrent license that can be used by multiple Quick Test users.
Add-ins Manager
Default Add-ins ActiveX Visual basic Web Other Add-Ins Siebel Java SAP Oracle .Net and many more
Environments Supported
Basic
Web Technologies HTML DHTML XML Browsers Netscape Internet Explorer AOL Advanced Web Technologies JavaScript Java ActiveX
Environments Supported
Multimedia
Flash RealAudio/Real Video MS Media Player ERP Solutions mySAP.com Siebel 2001 Oracle PeopleSoft .NET Win Forms Web Forms NET Control
Technologies
Environments Supported
Web Services XML WSDL
Operating
Environments Supported
Terminal
Emulators
ERP/CRM Baan PeopleSoft Windows Siebel 5, 6 GUI Clients Oracle GUI Forms
QTP is started, you should select only the add-ins for technologies that are used with your application. Some of the available add-ins are
ActiveX - For testing software written using ActiveX (also known as COM) technology. This technology allows people to create objects in one language and use those objects within other languages/applications Visual Basic - For applications written in the Visual Basic language Web - For testing web applications written in any language. In web applications, we interact with the application though a web browser and so the web
QTP Screen
Test toolbar: containing buttons to assist you in the Important Toolbars testing process(ex: record,Run..) Debug toolbar: containing buttons to assist you in debugging your test Action toolbar: containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow Test pane: containing two tabs to view your testthe Keyword View and the Expert View Test Details pane : containing the Active Screen Data Table: containing two or more tabs to assist you in parameterizing your testGlobal and one tab for each Action
* QTP works on objects in Application Under Test (AUT) by storing object description. This object description is known as a Test Object. Each Test Object supports predefined sets of Methods and properties * The actual object in the AUT which is identified for a Test Object is called the Run-time object. * A Test Object can always be present without the AUT * Run-time object can only be present when AUT is up and running
Recording Modes in QTP takes full Normal(This mode is the default and
advantage of Quick Test's test object model, recognizing the objects in your application regardless of their location on the screen)
Analog Recording (Alt+Shift+F3):(enables you to records the exact mouse and keyboard operations you perform in relation to either the screen or the application window. In this recording mode, Quick Test record and tracks every movement of the mouse as you drag the mouse around a screen or window.
This mode is useful for recording operations that cannot be recorded at the level of an object, for example, drawing a picture, recording a signature produced by dragging the mouse. Note: You cannot edit analog recording steps from within Quick Test.
a) b)
Note: a) The steps recorded using analog recoding is saved in a separate data file. This file is stored with the action in which the analog steps are recorded. b) When you record in analog recording mode, quick test adds to your test a Run analog statement that calls the recorded analog file.
3. Low Level Recording (Ctrl+Shift+F3): Enables you to record on any object in your application, whether or not QuickTest recognizes the specific object or the specific operation. This mode records at the object level and records all run-time objects as Window or WinObject test objects. Use low-level recording for recording in an environment or on an object not recognized by QuickTest. You can also use low-level recording if the exact coordinates of the object are important for your test or component. Note: Steps recorded using low-level mode may not run correctly on all objects.
Note: - a). Analog recording records only the one-Step in the test tree that calls the external analog data file.
b).
Low-Level recording, Analog recording option is not available while editing a test. This mode records at the object level and records all run time objects as window or win object test objects. Quick Test does not support virtual objects for analog or low-level recording.
c).
Note:
Runs your test with the execution arrow to the left of the test tree, marking each step or statement as it is performed. If the test contains multiple actions, the tree view expands to display the steps and the expert view displays the script of the currently running action. This option requires more system resources.
Fast:
Runs your test without the execution arrow to the left of the test tree and does not show the tree view or expert view of each action as it runs. This option requires fewer system resources
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 creating test cases during these training exercises. 3. Click OK. QuickTest Professional launch windows open on your screen.
1.
Note: If the QuickTest WELCOME window appears, deselect the option to ALWAYS SHOW ON START UP. 4. Open the Mercury Flight Reservation application. The login window appears. 5. In the AGENT NAME field type: qtp. In the PASSWORD field type: mercury. The Mercury Flight Reservation launch windows open on your screen.
6. Re-open QuickTest Professional then click FILE > NEW TEST from the QuickTest menubar. 7. Click RECORD. The RECORD AND RUN SETTINGS window opens. 8. Note: Additional environment tabs will appear in this dialog depending on which Add-ins you have loaded. In the example below the Web tab is available because the Web Add-in has been loaded. 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
Record
the Test:
1. Begin recording user actions by redisplaying the flight reservation screen. (You may need to click the Flight icon on your windows taskbar). Notice that the word RECORDING flashes in red at the bottom right side of the screen. 2. Record the user actions that will create a new flight reservation. Make up your own data or use the following information: date of travel 12/12/09, flying from Frankfurt to London.
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 on the flight reservation screen. 6. Click NEW ORDER button. .
Note: Clicking the NEW ORDER button at this step ensures that the screen appears exactly as it did at the start of the test. This is referred to as resetting the end condition to match the initial condition of the test. 7. From the QuickTest menu, click STOP to end the test. 8. Click FILE > SAVE to store your test as <your initials>_CreateOrder
Run
the Test: 1. If the test created in Part 2: Record the Test is not already displayed on your screen, find and open it by clicking FILE > OPEN TEST from the QuickTest menu bar. 2. Click RUN. In the RUN RESULTS location tab, choose the option to save your test results to a temporary file. Click OK to close the window. 3. Open the Mercury Flight Reservations application. The test should automatically begin repeating the actions you recorded earlier. 4. When the test run is complete, the test results will appear on your screen. Note: If the RESULTS SUMMARY window is not automatically displayed when
Panes in QTP
1. Test Pane - Tree view or Keyboard view - Expert view 2. Active screen 3. Debug viewer 4. Data table - Global - Action
Test Pane
Its
a place where we can see the script for the action we perform on the application. It provides two main views of a script: Keyword View and Expert View. They are selected from tabs at the bottom of the Quick Test Professional window.
Keyword View
Keyword View is QTP's default test procedure interface. It displays the automation steps of a test procedure as a
descriptive tree of Actions and functions. The tree contains columns listing the Action or function name, any parameters, and comments. This mode is most useful for the beginners in operating with the tool. This view allows the user to select the objects either from the application or from the Object Repository and the user can select the methods to be performed on those objects. The script is automatically generated. Users can also set check points from keyword view.
QTP
is having two views to access and analyze the test script that is Keyword View and Expert View. Keyword View helps to display the recorded script in steps or hierarchical format. It is having some default columns which are important to understand the recorded script. There are four important columns Item- It displays the icon based steps that is, you have done while recording the test. It contains window name, object name, function and etc. Operation- Operation column shows the type of operation which you performed in the items. For examples select, click and etc. Value- This column shows arguments which you have given while creating your test script and argument value for selected operation. Documentation- Documentation section will display some shortdescription in simple Englishabout your step or item. It comes automatically.
Expert View
Quick Test Pro displays the source code (VB
Script) of the tests in this view. For each object and method in an Expert View statement, a corresponding row exists in the Keyword View
Active Screen
The
Active Screen provides a snapshot of your application as it appeared when you performed a certain step while recording your test.
Active Screen can contain detailed property information about each object displayed on the page. This enables you to easily parameterize object values and insert checkpoints, methods, and output values for any object in the page.