QTP


Technologies Supported

  • Standard Windows applications
  • Web applications
  • Visual Basic applications

Additional Quick Test add-ins support:
  • Java
  • ActiveX controls
  • Oracle Forms
  • SAP Solutions
  • .NET Windows
  • Web Forms
  • Siebel
  • PeopleSoft 
  • Web Services
  • Terminal Emulator applications
  • Silverlight
  • WPF


Types of Recording modes
  • Standard Recording - Records the test in terms of GUI objects.  
  • Analog Recording - Enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window.
  • Low Level Recording - This mode records at the object level and records all run-time objects as Window or WinObject test objects.


Object Spy

  • It can be used to view the properties and values of an object in any open application. Click the pointing hand to select the object in the application. The object’s properties (Test object properties and Run-Time object properties) and methods can be identified. The object’s hierarchy tree is also displayed. To perform other events such as mouse clicks or window focus hold the CTRL key.
  • Choose Tools > Object Spy to open the Object Spy dialog box and display the Properties tab. Alternatively, click the Object Spy button from the Object Repository dialog box. 


Object Identification
Object Identification While Recording
Stores Object as Test Object, Determining the class it fits. For each test object class, Quick Test always learns a list of Mandatory properties. Checks whether this description is enough to uniquely identify the object. If it is not, Quick Test adds Assistive properties, one by one, to the description, until it has a unique description.

Object Identification During Test Run
Searches for a run-time object that exactly matches the description of the test object.
It expects to find a perfect match for both the mandatory and any assistive properties of test object uses Smart Identification mechanism to identify an object, even when the recorded description is no longer accurate.

Smart Identification:
The Smart Identification mechanism uses two types of properties:
Base filter properties - The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object.
Optional filter properties - Other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable.



Types of Object Repositories

There are 2 types of Object Repositories

  • Local Object repository - It stores test objects that can be used in one specific action and its extension is (.mtr) mercury test repository.

  • Shared Object repository – It contains test objects that can be used in multiple actions and its extension is (.tsr) test shared repository.



Checkpoints in QTP 


A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables you to identify whether you’re Web site or application is functioning correctly.






















Debug Viewer
The Debug Viewer option in the View menu is used to view, set, or modify the current value of objects or variables in the test, when a test stops at a breakpoint.
Watch Expressions Tab: Use the Watch Expressions tab to view the current value of any variable or VBScript object that you enter in the Watch Expressions table. Paste or type the name of the object or variable into the Name column and press ENTER to view the current value in the Value column.
Variables Tab: Use the Variables tab to view the current value of all variables, in the current action or selected subroutine, identified up to the point where the test or component stopped
Command Tab: Use the Command tab to execute a line of script in order to set or modify the current value of a variable or VBScript object in your test or component.



Synchronization Points

Synchronization point maintains the time coordination between testing process and your application process. Used for time mapping between QTP and Application. Quick Test waits a set time interval for an application to respond to input. The DEFAULT wait interval is up to 20 seconds. Following are the synchronization point types: 
  • Wait 
  • WaitProperty 
  • Exist 
  • Sync


Actions
1.    Non-Reusable Action—an action that can be called only in the test with which it is stored, and can be called only once.
2.    Reusable Action—an action that can be called multiple times by the test with which it is stored (the local test), as well as by other tests.
3.    External Action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.



Recovery Scenario

It enables Quick test to detect and handle when unexpected error occurred during execution time


Recovery Scenario Manager
Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps:
1. Triggered Events: The event that interrupts your run session.
    E.g. A window that may pop up on screen, or a QTP run error
2. Recovery Steps: The operations to perform to enable QTP to continue running the test after the trigger event interrupts the run session.
    E.g. Clicking an OK button in a pop-up window, or restarting Microsoft Windows
3. Post Recovery Test-Run: The instructions on how QTP should proceed after the recovery operations have been performed, and from which point in the test QTP should continue
    E.g. You may want to restart a test from the beginning, or skip a step entirely and continue with the next step in the test.



Data Driven in Automation
The test scripts should be built in such a way that it should work for different sets of data without any changes to the test script.

Example:
Consider a scenario where there are a large number of user credentials for an application. 
We need to login to the application with each of these credentials to find out which of the user credentials are working properly and which are not.  In order to complete this task, we can create a script in QTP which would read each of the user credentials and try to login to the application and at the end would report the results.


How it works in QTP?















Test Script & Object Repository: The Test Script and the Object Repository (if we are not using complete Descriptive Programming) read the data from the external sheet and then use it on the application under test.
External Data Source: There will be an external data source that will contain all the test data that we need to run our test script.
 

Various Data Sources for QTP

QTP supports a wide variety of Data Sources from where we can extract data for our test scripts. Some of these ares–

  • Microsoft Excel
  • Text files
  • XML files (using as Environment Variables, XML DOM objects, etc)
  • Databases like SQL-Server, Oracle, MS-Access, My-SQL, etc.
Different ways to extract data in QTP

Method 1: Using QTP and DataTable. Here, we can save all our data in QTP DataTable and write the script which will extract data from the data table.

  













Method 2: Using QTP, Data Table and External Source (MS Excel, DataBase, etc). In this method, the QTP first copies the data from the External Source into QTP data table. It then uses the QTP in-built methods to read data from the data table.

 
















Method 3: Using QTP and External Source. Here the data is stored in External Source and QTP uses its COM methods to read the data directly from the External Source only like MS-Excel.  









By using VB Script, the data can be access directly from the external sources. Few examples are as follows:

  • Data access directly from MS-Excel















    

  • Data access directly from Database
 







No comments:

Post a Comment