The ideal way of learning QTP or for that matter any other tool is to go through the basics first. Once you are clear with the basics, you can start learning the advanced concepts of the tool. This article aims to list out all the basic concepts that QTP beginners should go through as part of their initial learning of the tool. For those of you who have had exposure to QTP, this article would serve as a checklist to see whether or not you have missed any of the basic concepts.
Basic Concepts in QTP
- What is QTP? This is the topic you should ideally start with. You should have an idea of what QTP is all about, what type of testing you can do with QTP, different types of applications that it supports & other general stuff like what is the latest QTP version, from where you can download QTP, what are the different license modes etc.
- What sort of Applications / Test Cases should be considered for Automation using QTP. Now this is a very important concept that must be looked at before starting with any automation project using QTP. You should be able to analyze your manual test cases and your application to see if it is can be automated or not. If it can be automated, you should be able to figure out if you’d really derive any benefit by automating the test cases.
- Get familiar with the QTP tool. Before starting to create test scripts in QTP, you should be familiar with the QTP tool. You should be aware of the different panes and controls in the QTP window. You should know what they are and for what purpose they are used.
- Test Objects and Object Repositories. You should know what are test objects, what is object hierarchy, how you can identify objects using QTP and how you can identify unique properties for your objects. You should also know what object repositories are, why they are used and how you can use them to add objects.
- Creating Test Scripts / Actions. Now comes the real scripting part. You should be able to use the record & playback method to create & run test cases. Together with record & playback method, you should be able to ‘write’ your code after associating object repositories to your actions.
- Analyzing your Test Run Results. Once you run your test scripts, you should be able to analyze the test run results. You should be able to find out which steps have passed & which have failed. You should also be able to identify the test case flow using the run results.
- Creating Functions & Using Function Libraries. You should be able to identify reusable flows & functionality in your test cases. You should be able to write user defined functions for the reusable flows. You should also be able to create new function libraries, add some reusable functions to these function libraries and use these functions in your script by associating the function libraries to your test script.
- Working with Data Tables. You should know how you can use data table to pass on data values in your test script. You should also be aware of how you can take data from excel sheets and use it in your scripts.
- Basics of Debugging. You should have a clear understanding of the basic debugging techniques in QTP. You should know how to use breakpoints in your code. You should also know how you can make use of the debug viewer pane while running your test scripts.
What is QTP?
QTP or QuickTest Professional is an automation tool which is primarily used for functional and regression testing. With QTP, you can automate (write code for) the manual steps that you would perform to test a particular scenario. As an example let us consider that you want to verify that the log in functionality of your web application is working fine. Now to test this scenario manually, you would generally follow these steps –
- Open web browser and enter the URL of the application.
- Navigate to log in page.
- Enter user id & password and then click on Log in/Submit button.
- Verify that log in is successful.
Now consider a case where you have to test this functionality say a 100 times or maybe you want to test the log in functionality for 100 different users. Doing this same thing manually again & again is a time consuming & boring activity. Now what if you can automate this entire process? What if you can write some code, which can replicate your actions that you do manually (like opening the application URL in web browser, entering user id & password, hitting log in button and verifying successful log in).
This is exactly what QTP would do for you. You can write your code for log in scenario in QTP and run the code any number of times with a single click of a button, of course with same or different data (as per your wish).
QTP was originally developed by Mercury Interactive Corporation and it was known as Mercury QuickTest Professional. In the year 2006, Mercury Interactive was acquired by HP and from then onwards QTP is available as HP QuickTest Professional. The latest version of the tool is Version 11.00 which was released in 2010. The previous version i.e. QTP 10 was released in 2009.
Different Types of Applications that can be tested using QTP
QTP can be used only on Windows Operating System. QTP cannot be installed on other operating systems such as Unix, Linux etc. However there are many 3rd party tools such as Putty, Hummingbird Host Explorer etc using which you can access Unix / Mainframe server in Windows OS. QTP can be configured to work with these 3rd party tools and thus in a way can be used for testing applications in Mainframe/Unix etc.
QTP can be used to automate a variety of applications built using different technologies. It is used most commonly for web applications. Other than web applications QTP can be used on applications developed using Java, .NET, VB, SAP, Siebel, Mainframes, Oracle, Delphi, WPF, Ajax, Silverlight, People Soft, VisualAge Smalltalk etc.
Primarily QTP is used for automation of GUI based application but it can also be used for Non-GUI based testing such as web services testing, database testing and file system operations.
QTP Download/License Information
HP QuickTest Professional is a licensed software available from HP Software Division. QTP has 2 different license modes – Seat License, in which every system where QTP is installed has a separate license & Concurrent License where QTP is installed on individual machines but the license is installed on a license server. Here, the individual machines should have access to the license server, then only they can use QTP.
Other than the licensed version, the trail version of QTP is also available for download from HP website. The trial version of the software is available for 30 days.
Can your Test Cases be Automated using QTP?
In this section, we’ll see what sort of applications / test cases can’t be automated using QTP:
- Does QTP support the technology used to build your application? Now this is the first thing that needs to be checked. There are certain programming languages such as C++ that are not supported by QTP. Hence if yours is a C++ application then QTP is not for you.
- Do your Test Cases require Manual Intervention? Consider an end to end order creation test case where once the order request is placed, manual intervention is needed to help flow the order from one system to another. Its always better not to automate such cases.
- Does your Test Case needs to be checked in multiple Browsers? There are many browsers such as Chrome, Netscape, Safari etc that are not supported by QTP. Hence if you want to check your test cases in any of these browsers, QTP wouldn’t be of any help to you.
- Some things just can’t be fully automated. Consider a scenario where you need to place an order and verify that an sms is sent to the concerned person. Such test cases can’t be automated completely. Though it can definitely be argued that the scenario can be partially automated.
Is it Worth Automating? The Return On Investment (ROI) Perspective
Now, there would be many cases where you’d have some test cases to automate but it would really not make any sense to automate them. In this section, we’ll discuss some of those scenarios.
- Test Cases that need to be executed once or twice. Imagine that you have some test cases that you need to execute only once or twice. There’s really no point in spending few hours to automate some test case(s) that you would running once or twice only, that too when total execution time of all the runs is lesser than the time taken to automate those test cases. Ideally greater the number of runs of your automated scripts, better is the ROI.
- Does your application undergo frequent changes? Now if the application that you are planning to automate undergoes frequent changes, then most of your time would be spent on maintenance of the scripts. Ideally, such applications should not be considered for automation. Lesser the changes needed in your application, lesser is the effort required for test case maintenance and hence greater is the ROI.
- Do It Now testing. Suppose that at this moment you get a list of test cases that need to be checked as soon as possible. In this situation, the primary goal is to finish the testing as soon as possible rather than spending a couple of hours to automate the scenarios. Hence automation is generally a No for such scenarios.
- Ad-hoc testing. If you have any test cases that need to be checked in an ad-hoc manner, without any proper plan or test case flow, then it is always better to keep them out of the automation scope.
Now this is definitely not an exhaustive list that covers all the points that should be kept in mind while deciding to go for automation using QTP. If you have any other points to add, please use the comments section to let us know about the same. Happy Reading .. ::-))