Thursday, February 4, 2010

QTP

QuickTest Professional

QTP is an automated functional Graphical User Interface (GUI) testing tool created by the HP subsidiary Mercury Interactive that allows the automation of user actions on a web or client based and desktop computer application. It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test.

As part of a functional test suite, it works together with Mercury Interactive WinRunner and HP Quality Center and supports enterprise Quality Assurance.

Overview

QTP is UI automation software designed for testing Web-based and Windows based applications running on Microsoft Windows. Like other test automation tools, it works by identifying the objects in the application UI or a web page and performing the desired operations on them (like mouse clicks or keyboard events); it can also be used to capture object properties like name or handler ID etc. To perform these actions, QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test. To perform sophisticated actions, users may need to manipulate the underlying VBScript.

Though QTP is usually used for "UI Based" Test Case Automation, it can automate some "Non-UI" based Test Cases. (e.g. API (Certification testing), Database Testing, etc.)


Different Releases or Versions are as follows:-
1)10.0 - Released in 2009
2)9.5
3)9.2 - Released in 2007
4)9.0 - Released in 2006
5)8.2 - Released in 2005


License models

QTP comes with a 14-day demo license, and supports a node-locked seat license, as well as floating or concurrent licenses.

To execute, users select the playback button, which re-executes the commands against the application under test. In real world usage, simply recording and playing-back actions is generally not valuable, as it simply repeats a test already executed and may no longer be valid (because the record now exists in the system, for example).

User interface
QuickTest provides two main views of a script: Keyword View and Expert View. They are selected from tabs at the bottom of the QuickTest 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, parameters, and comments. This mode is useful for the beginners. 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 checkpoints from the keyword view. Users without technical knowledge may be able to understand the Keyword View, but more experienced users and users needing to perform more complicated actions may need to switch to Expert View.

Expert viewIn Expert View, QTP allows display and editing of the test's source code using VBScript. All test actions can be edited here except for the root Global action. Expert View acts as an IDE for the test. It includes many standard IDE features, such as breakpoints and also the codes.

LanguagesQTP uses VBScript as its scripting language. VBScript supports classes but not polymorphism and inheritance. Compared with Visual Basic for Applications (VBA), VBScript lacks the ability to use some Visual Basic keywords, does not come with an integrated debugger, lacks an event handler, and does not have a forms editor. HP has added some of these features to QTP, such as a debugger, but QTP's functionality is more limited in these areas compared with testing tools that integrate a full-featured IDE, such as those provided with VBA, Java, or VB.NET.

QTP is widely/most popularly used Functional/Regression Test automation tool. It was developed by Mercury Interactive and acquired by HP.

But anyway, we need to do proper tool evaluation before selecting QTP for automating testing of our application.

Since QTP can support external add-ins, it can be used for many different applications.

Some add-ins (e.g ActiveX, VisualBasic,Web) are built-in with QTP, and some other add-ins (e.g Java, .net, TE (termial emulator))are external add-ins.

We can load only the required add-ins when opening the QTP IDE. So it will be helpful to improve the execution speed.

QTP will support Keyword Driven and Data Driven testing. We can create our own test automation framework also based on our own requirements for test automation.

It is very important to understand how QTP works. Because it will help to learn any other feature in QTP easily. And also it will help to design an effective automation framework and also it help to resolve any issue faced during automation script development and also during script execution.

All we know that every test case should have Test Steps and Expected Results.

As QTP is used for executing these test cases, QTP also should have way for handling both Test Steps and Expected Results.

Handling Test Steps means QTP should be capable of navigating any path/page in any website or in any software application.
So, for doing this QTP should be able to recognize any control/object in any application/webpage. For recognizing the object, it should know the properties of those objects beforehand. It is achieved by storing the properties of the objects in a centralized place known as Object Repository.

While running the test script, the objects in the application are identified/recognized by comparing the properties of them with the properties stored in the Object Repository. By doing this execution of Test Steps becomes possible.

QTP is having Datatables (similar to Excel sheet) for supporting execution for multiple iterations of same steps with different data. For example, assume that we need to execute two test cases, one for logging into a website using UPPER case username and another test case for logging into a website using lower case username.

For executing these two test cases, the steps will be same. The only difference is in the test data.

It can be easily done in QTP by putting these input usernames in Datatable and make the Script to execute it two times.

Next, we need to think about handling Expected Results. The purpose of testing is comparing the Actual result with the predefined Expected Results. It is achieved by using Checkpoints.

There are many checkpoints available in QTP. They are, Standard Checkpoint,Text Checkpoint, Bitmap Checkpoint, Database Checkpoint, accessibility Checkpoint and XML Checkpoint.

Actually QTP can be used simply as Record and Play type tool for automation of simple steps on simple applications. But it should be extensively used by writing user defined functions and many other features to get more benefit from it.

QTP is not using any Proprietary Script. It uses commonly available VBscript. So writing script will be simple. And also, vbscript is commonly used in many places such as Web development (ASP), and in windows administration works. So we can easily find lot of already available user-defined functions and help articles in the Internet.

And also, QTP supports COM model. i-e Any methods and properties of any COM based application can be easily accessed from QTP. For example IE(Internet Explorer) and Excel Objects can be created within QTP script. It is applicable for QTP itself.
i-e Object of QTP itself can be created and handled. It is known as Automation Object Model.

Basically QTP is a functional/Regression testing tool. But it can be indirectly used for testing performance also. (i-e QTP scripts can be be called from performance testing tool "Load Runner"). And also, QTP is having limited performance testing options such as start and end transactions which will be helpful to find execution time for particular block of steps.

QTP can be closely integrated with the Test Management Tool Quality Center (QC). QC can be effectively used to run QTP scripts in multiple remote machines to complete execution of many test scripts in less time.

The user friendly IDE which has Keyword view, Expert view, Datatable, Active screen, object repository editor/manager,step generator, function generator,object highlight feature, intellisense, recovery scenario manager, update run feature and simple Test/Action handling features makes the Script developer/execution work easy. The IDE is integrated with useful tools such as ObjectSpy. The IDE has standard development features such as Debug.

No comments: