Basics of QTP (Quick Test Professional)

QTP is commonly / most commonly used Functional / regression Test automation tool. It was developed by Mercury Interactive and acquired by HP.

Anyway, we need to properly evaluate the tool before selecting QTP to automate the testing of our application.

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

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

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

QTP supports Keyword Driven and Data Driven testing. We can create our own test automation framework, also based on our own test automation requirements.

It is very important to understand how QTP works. Because it will help you learn other functions in QTP easily. And it will also help to design an effective automation framework and it also help to solve any problem that arise during the development of automation scripts and also while running scripts.

I will explain as below,

All we know is that every test case must have test steps and expected results.

Since QTP is used to run these test cases, QTP should also have a way to handle both test steps and expected results.

Handling test steps means that QTP must be able to navigate any path / page on any website or in any software application.

To do this, QTP must be able to recognize every control / object in every application / web page. To recognize the object, it must 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.

During the execution of the test script, the objects in the application are identified / recognized by comparing their properties with the properties stored in the Object Repository. Doing this enables the execution of Test Steps.

QTP has Datatables (similar to Excel sheet) to support the execution of multiple iterations of the same steps with different data. For example, suppose we need to run two test cases, one to login to a website with a username in upper case and another test case to login to a website with a username in lower case.

The steps are the same for performing these two test cases. The only difference is in the test data.

It can be easily done in QTP by putting these entered usernames in Datatable and running the Script twice.

Next, we need to think about dealing with expected results. The purpose of testing is to compare the actual result with the predefined expected results. It is achieved by using Checkpoints.

Many checkpoints are available in QTP. These are: Standard Checkpoint, Text Checkpoint, Bitmap Checkpoint, Database Checkpoint, Accessibility Checkpoint and XML Checkpoint.

Actually, QTP can be easily used as a recording and playback tool for automating simple steps in simple applications. But it needs to be widely used by writing user-defined functions and many other functions to take more advantage of it.

QTP does not use its own script. It uses commonly available VBscript. So writing a script will be easy. And also vbscript is often used in many places, such as web development (ASP), and in Windows administration work. So we can easily find many already available user-defined functions and help articles on the Internet.

And also QTP supports the COM model. i-e All methods and features of any COM based application are easily accessible via QTP. For example IE (Internet Explorer) and Excel objects can be created within QTP script. It applies to QTP itself.

i-e Object from QTP itself can be created and processed. It is known as Automation Object Model.

Essentially, QTP is a functional / regression testing tool. But it can also be used indirectly to test performance. (i-e QTP scripts can be called from the performance test tool “Load Runner”). And also QTP has limited performance test options such as start and end transactions, which will be useful to find the execution time for a particular block of steps.

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

The user-friendly IDE with keyword view, expert view, datatable, active screen, object repository editor / manager, step generator, function generator, object marker function, intellisense, recovery scenario manager, update run function and simple test / action handling functions 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.