Friday, June 3, 2011

Virtual objects

Virtual objects:
Virtual object is a process of making the QTP to treat a specified area or user defined object as a specific object.

Virtual object manager:
Virtual object manager is a feature provided by QTP which is used for creating and managing the virtual objects. Once a virtual object is created it will be available to all the tests unless until we delete it.

Navigation:
·         Activate the menu item tools
·         Go to virtual objects

Step-1:Creation Of Virtual Object

·         Select the option new virtual object
Creation Of New Virtual Object



New Virtual Object Window


·         Click on next
·         Specify the desired class(type) of the object
·         Click on next
·         Mark the area in the application with the help of mark object button
·         Click on next

·         Select one of the following options
o   Entire parent hierarchy
o   Parent only
·         Click on next
·         Specify the desired object name
·         Specify the desired collection name
·         Click on finish

Virtual object manager:

Virtual object manager is a feature provided by QTP which is used for creating and managing the virtual objects. Once a virtual object is created it will be available to all the tests unless until we delete it.

Below are the important points which need to be noticed by us prior to using Virtual Objects in QTP.

Important Points :
1. A group of Virtual Objects are stored in Virtual Object Manager under a descriptive name known as Virtual Object Collection”.

2. Normal recording on Virtual Objects is only supported by QTP.

3. Virtual Objects can only be used when recording & Running the tests. It does not support the checkpoint.

4. The Virtual Object Collections shown in the Virtual Object Manager are stored in our computer (where they are created) and not in the tests that include the virtual object steps. This means that if you the virtual object in a script, the object will be recognized during the run session only if it is run on the computer containing the appropriate Virtual Object Definition. To Copy your virtual object definitions to another computer, copy the contents of your
\Dat\VoTemplate folder (or individual collection files within this folder) to the same location on the destination computer.

5. Virtual Objects can only be defined for objects on which you can click or Dbl click and that record a click or Dbl click operation. Otherwise, the virtual object is ignored. For example, if you define a virtual Object manager over the WinList object, the “Select” operation is recorded, and the virtual Object operation is ignored.

6.  Virtual Objects cannot be spied by using Object Spy.
 

Friday, May 27, 2011

Record and Run Settings:

Record and Run Settings:

For every new test one has to compulsorily do these settings before recording or running. These settings will make to understand on which applications it need to concentrate while recording or running.

Navigation:     
1) Activate the menu item test
2) Select the option record and run settings
3) Select one of the following options
i) Record and run test on any opened windows based application
ii) Record and run on this application (opened on session start)
4) If at all second option is selected then click on add button
5) Browse the desired application part
6) Click on OK
7) Click on apply & OK.

Operational overview of Recording:
1) It will generate corresponding script statements for every user action on the application.
2) It will store the required related test object information in the object repository.

Operational overview of Running:

During running QTP will doing the following.
1) It will read the script statement and understands what action to be performed on which object.
2) Then it realizes it need to identify the object first to perform the action
3) To identify the object it requires some information for that information it will go the object repository and search.
4) Once the information is found using this information it will try to identify the original object.
           Once the object is identified it will perform the action on it.

(Record and Run Settings)

Record and Run Settings:


QTP Automation Object Model:

Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program.




Thursday, May 26, 2011

QTP Life Cycle

       

QTP life cycle contains six phases

Ø  Test planning
Ø  Generating the basic test
Ø  Enhancing the test
Ø  Debugging the test
Ø  Executing the test
Ø  Analysis the Results

Test Planning:
In this phase the automation test lead will do the following
Ø  Understanding the requirements
Ø  Identifying all the areas to be automated
Ø  Analyzing both the negative and positive flow of the application
Ø  Preparing the automation test plan document based on the analysis
Ø  Preparing the tool ready with all the pre configurationally settings for the further operations.

Generating the basic test:
In this phase the automation test engineer will generate the basic test engineer will generate the basic test for both the +ve and –ve flow of the application

Enhancing the Test:

One can enhance the script in the following ways

Ø  Adding comments
Ø  Inserting the script statement manually
Ø  Inserting the programmatic statements

Ø  Inserting the check points

Ø  Parameterizing the test
Ø  Inserting the output value statements
Ø  Synchronizing the test
Ø  Inserting the transactional points for measuring transactions

Record and Run Settings In QTP:

Record and Run Settings:

 For every new test one has to compulsorily do these settings before recording or running. These settings will make to understand on which applications it need to concentrate while recording or running.
Navigation:        
Ø  Activate the menu item Automation
Ø  Select the option record and run settings
Ø  Select one of the following options
Ø  Record and run test on any opened windows based application
Ø  Record and run on this application (opened on session start)
Ø  If at all second option is selected then click on add button
Ø  Browse the desired application part
Ø  Click on OK
Ø  Click on apply & OK.
(Record and Run Settings Window in QTP)


Operational overview of Recording:
 During recording QTP will do the following.
Ø  It will generate corresponding script statements for every user action on the application.
Ø  It will store the required related information in the object repository.
Operational overview of Running:
During running QTP will doing the following.
Ø  It will read the script statement and understands what action to be performed on which object.
Ø  Then it realizes it need to identify the object first to perform the action
Ø  To identify the object it requires some information for that information it will go the object repository and search.
Ø  Once the information is found using this information it will try to identify the original object.
Ø  Once the object is identified it will perform the action on it.


Recording in QTP

      
            Recording is a feature provided by QTP, by which we can capture the user actions, but remember recording is only to get familiar with QTP.

Recording Modes:

There are three types of recording modes in QTP
Ø  Context sensitive or Normal recording mode
Ø  Analog Recording Mode
Ø  Low-level Recording mode.

Context sensitive Recording mode:
It is used for recording the operations performed on the standard GUI object in different situations.

Navigation:
a)    Click on the record button displayed on the QTP test pane or Press F3 after launching the QTPro


  OR
a)   Click on Automation displayed in the menu bar.
b)    Click on the record button available there.



Analog Recording Mode:

It is a special recording mode provided by QTP, which is used for recording the continuous operations.

Navigation:
·        Keep the tool under normal recording mode
·        Activate the menu item test
·        Select the option analog recording
·        Select one of the following option
·        Record relative to the screen
·        Record relative to the following window
·        If at all second option is selected specify the window title with the help of the Hand Icon
Click on start analog record

Low-Level Recording:

It is a special recording mode provided by QTP, which is used for recording at least some minimum operations on the non-supported environments also.

Navigation:
·        Keep the tool under normal recording mode
·        Activate the menu item test
·        Select the option Low Level recording
·        Start Recording