Tuesday, October 2, 2012

Parts of QTP

There are 7 parts of QTP.
1) Test Pane
2) Active Screen
3) Data table
4) Debug Viewer Pane
5) Information Pane
6) Missing Resources Pane
7) Tool options

1) Test Pane: Test pane is an area provided by QTP, which is used for developing, viewing and modifying the test script. It represents the Test script in following two views.


# Expert view: represents the script in VB script format.

# Keyboard View: represents the scripts using a graphical user interface, which are further, divided, into four parts like 1) Item 2) Operation 3) Value 4) Documentation


Note: Any modification done in one view will be reflected in other view.

The Test Flow pane is comprised of a hierarchy of actions and action calls in the current test, and shows the order in which they are run. Each action is displayed as a node in a tree, and includes calls to all of a test's actions. The steps of the action that you double-click in the Test Flow pane are displayed in the Keyword View and Expert View.
The Test Flow pane is displayed by default when you start QuickTest Professional. To view the Test Flow pane, click the Test Flow Pane button or choose View > Test Flow.

QTP test flow pane
Test flow pane in QTP.

The Test Flow pane uses the following icons to indicate the different types of item in the hierarchy:

TEST Flow pane in QTP

Tips:




  • You can right-click in the Test Flow pane title bar to view available display options and decide how to display the Test Flow pane. For example, you can auto hide the pane, dock it, or close it.
  • You can click the Test Flow Pane toolbar button to hide or show the Test Flow pane view.

  • Working with Actions in Test Flow Pane
    You can perform the following operations in the Test Flow pane:
    • Display an action in the Keyword View and Expert View. Double-click an action in the Test Flow pane to show only that action in the Keyword View and Expert View.

    • View or hide the sub-nodes in the test. Right-click the Test node in the tree and select Expand All orCollapse All to view or hide the sub-nodes in the tree. You can also select the Test node and press + or * on the keyboard to expand all the nodes in the test, and to collapse the nodes.

    • Display the test properties. Right-click the Test node in the tree and then select Settings to display the Test Settings dialog box. Details of the test and its path are displayed.

    • View or hide the sub-nodes of an action. Right-click an action in the tree and then select Expand Sub Treeor Collapse Sub Tree to view or hide the sub-nodes in the action. You can also select a sub-node and press +or * on the keyboard to expand the node and to collapse the node.

    • Display the action properties. Right-click an action in the tree and then select Action Properties to display the Action Properties dialog box. The name of the action and its path are displayed.

    • Display the action call properties. Right-click an action in the tree and then select Action Call Properties to display the Action Call Properties dialog box.

    • Work with the Object Repository. Right-click an action in the tree and then select Object Repository to open the Object Repository window, which displays a tree containing all objects in the current test.

    • Manage Actions. Right-click an action in the tree and then select Copy or Delete.
      • Select Copy to open the Select Action dialog box and create a copy of the action in your test.

      • Select Delete to remove the action from your test.

    • Run the test. Right-click an action in the tree and then select Run from Action or Run to Action to start a run session from the beginning of the selected action, or to run the test until the beginning of the selected action and then pause the run session.

    • Debug your test. Right-click an action in the tree and then select Debug from Action to begin (and pause) a debug session at the beginning of the selected action.

    • Change the run order of actions. You can perform either of the following steps to move a top-level action (a direct child of the test) in the Test Flow Pane tree, and change the run order of the test accordingly. The action and any sub-actions are moved.
      • Right-click a top-level action in the tree and then select Move Up or Move Down. You can also press Ctrl+Up arrow or Ctrl+Down arrow to move an action and its sub-actions.

      • Drag a top-level action in the tree up or down to the required location. When you drag a selected action, a line is displayed, enabling you to see the location in the tree to which the action will be moved. You can only drag top-level actions. Selecting the parent action automatically includes all its sub-actions. You cannot drag a sub-action, nor can you drag a parent action together with only some of its sub-actions.



      • If a test contains a call to an action that does not exist or cannot be found, the action still appears in the tree in the Test Flow pane, and QTP lists the action in the Missing Resources pane.

    Anatomy of QTP

    Add in Manager is a feature provided by QTP which makes QTP compatible with desired environments. QTP provides 3 add ins such as visual basic, active x and web. If the user does not select any add in by default qtp supports standard windows applications.

    How to launch QTP?
    start->programs->Quick Test professional->Quick Test professional

    Now Add in Manager will display.

    Do not select any add in and click on OK. Now QTP displays 4 options.

    1)Record
    2)Open existings
    3)Blank Test

    Do remember in QTP that test means script.

    Now QTP window displays.

    Go to Tools->Object Identification->Environment there you can see standard windows.

    Just to be clear: when you say "Windows apps", many languages can provide windowed applications. If you are targeting MS Windows platform, working with the OS, registry, clipboard, etc, THAT is what I would call "Windows Programming", where you leverage the OS. Otherwise, seems like it would be simply "Programming in a Windows Environment", and you can use any language that is appropriate. 

    For Windows programming refer http://www.sunlightd.com/archive/windows/gui/DialogBoxes.aspx

    Since you have not selected any add in by default QTP compatible with Standard windows applications

    Now Close the QTP window and again launch the QTP window and select add in web and visual basic.

    You will see under Tools menu->Object Identification the environments are visual basic, standard windows and Web.

    Now let us discuss about parts of the QTP:

    There are 7 parts in QTP
    1) Test pane
    2) Active Screen
    3) Data table
    4) Debug viewer pane
    5) Missing resources pane
    6) Information
    7) Tool options

    Menu bar has File Edit View Help etc. Whenever any feature you want to access in easy way you need to go to view menu and select that particular feature.

    Upon selecting that feature you will get an option to that particular window that hide toggle which is different from minimize and maximize options. Here upon mouse over that particular get focus and upon mouse moved away from that window automatically that window will minimized.

    Now we will discuss about each part of the QTP in details

    First one is Test Pane:
    As you know pane is an area so Test pane means here script area where you can view, edit and write scripts.

    Here select add in visual basic and launch the QTP application. Now I am recording a visual basic application which is nothing but Calculator.

    Vbwindow("Calculator").VbEditbox("value1").set "10".
    Vbwindow("Calculator").VbEditbox("value1").set "20".
    Vbwindow("Calculator").Vbbutton("add").click
    Vbwindow("Calculator").Vbbutton("sub").click
    Vbwindow("Calculator").Vbbutton("mul").click
    Vbwindow("Calculator").Vbbutton("div").click

    So inorder to understand the vb script we need to go reverse way so that you will have better understanding.

    We need to identify the top most object and then child object if exists and then child object if exists until you find final object.

    After you have identify you need to choose operations you need to perform.

    If the operation requires any value you need set using keyword set and in double quotes you need to provide value.

    if the operation requires only operation then call that operation simply.



















    Types of Automation tools




    Testing types are 2

    1)Black box testing 2)White box testing

    Black box testers will perform both functional testing and non functional testing.

    we can categorize automation tools in to two types
    1) Functional
    2) Non Functional
    Functional and non functional Automation tools:

    Say in practical example we have a log in page where we need to provide email and password. Upon providing those details we will click on log in button which displays home page.Here we are verifying log in feature and we are not verifying the time taken to display home page. Here verifying feature is called Functional testing and verifying time to display home page is called non functional testing.


    Example for functional tool is QTP

    Example for non functional tool is Load Runner

    So testers can be categorized as follows.



    1)Manual Testers

    2)Manual testers with Functional tools(QTP)

    3)Manual testers with Performance tools (Load Runner)

    4)Manual testers with Management tools (Quality Control)

    Now we can discuss about QTP(Quick Test professional):


    It was introduced by Mercury Interactive Corporation in 2002 and now it is been taken over by HP. It has 70% to 75% of the market share.

    As we know functional automation tools came into picture in 1994, which tool has ruled before QTP was introduced. It was Win runner. Surprisingly Win runner also introduced by Mercury Interactive Corporation. Now you guys have a question why QTP introduced by Mercury as competitor to Winrunner which has 70% of the market share.

    Win runner has an scripting language called TSL(Test script Language) which communicates with applications developed using structured programming language(eg c). As it partially supports to automate applications developed by OOPS, Mercury introduced QTP which has default scripting language vb script which is most popular. It also supports other scripting language only we need to configuration setting to support those languages.

    QTP Versions:

    5.5

    6.5 popular

    7.0

    8.2 Popular

    9.0

    9.1

    9.2 Popular

    9.5

    10.0

    11.0

    Thus there are several versions were introduced by Mercury. As different versions of Cars release every year which has some features where the basic functionality will not changes. Say for example previously we used to have manual rotating device for windows up and down. And later versions have power windows. So the windows up and down can be achieved even using previous version where as later versions make it job easy. In the Same way QTP also have different versions of software where basic functionality will not change.


    Add ins QTP:

    After we launch QTP, It was prompted to select add ins. IF we don't select any add in by default it will support standard windows applications like note pad, calculator etc. And QTP provides 3 add ins freely they are 1)visual basic 2)active X 3) Web. All the remaining add in can be purchased separately or as a whole with other add ins. Most of the company purchase add ins based on applications developed in their company.