This tutorial will give you an indepth understanding on HP QuickTest Professional, it's way of usage, record and play back of tests, object repository, actions, checkpoints, sync points, debugging, test results etc and other related terminologies.
QTP is a Functional testing tool which is best suited for regression testing of the applications. QTP is a licensed/commercial tool owned by HP which is one of the most popular tools available in the market. It compares the actual and expected result and reports the results in the execution summary.
Actions helps testers to divide scripts into groups of QTP statements called actions. Actions are similar to functions in VBScript, however there are few differences. By Default QTP creates a test with 1 action.
Actions helps testers to divide scripts into groups of QTP statements called actions. Actions are similar to functions in VBScript, however there are few differences. By Default QTP creates a test with 1 action.
A Data Table, similar to Microsoft Excel helps testers to create data driven test cases that can be used to run an Action multiple times. There are two types of Data tables.
Local Data Table - Each action has its own private data table also known as local data table which is can also be accessed across actions.
Global Data Table - Each test has one global data sheet that is accessible across actions.
Checkpoints, as the name says it all, it refers to a validation point that compares the current value for specified properties or current state of an object with the expected value which can be inserted at any point of time in the script.
Synchronization point is the time interface between Tool and Application under test. Synchronization point is a feature to specify delay time between one step and another of the test script.
For Example, clicking on a link may load the page is 1 second, sometimes 5 seconds or even it might take 10 seconds to load it completely. It depends on various factors such as the application server response time, network bandwidth , client system capabilities etc.
If the time is varying then the script will fail unless the tester handles these time differences intelligently.
Sometimes, QTP is unable to find any object that matches the recognized object description or it may find more than one object that fits the description, then QTP ignores the recognized description and uses the Smart Identification mechanism to recognize the object.
QTP's Smart Identification uses two types of properties:
Base Filter Properties - The basic properties of a particular test object class whose values cannot be changed without changing the essence of the original object.
Optional Filter Properties - Other properties also assist in identifying the objects of a particular class whose properties are unlikely to change often but can be ignored if they are no longer applicable.
Debugging, in automation testing context, is a systematic process of spotting and fixing the coding issues in the automation scripts so that the script will be more robust and can spot the defects in the application.
There are various ways to perform debugging using break points in QTP. Break Points can be inserted just by pressing "F9" or by using the Menu option "Run" → "Inserting/Removing Break Point".
There are various ways on handling errors in QTP. There are three possible kinds of error type one would encounter while working with QTP.
While executing the QTP scripts, we might get some Unexpected errors. In order to recover the test and continue executing the rest of the script from these unexpected errors, Recovery Scenarios are used.
QTP environment variables are special types of variables that can be accessed by all actions, function libraries and recovery Scenarios. There are inbuilt environment variables for Windows that are available to all the applications running on that particular system where as QTP environment variables are only available to that test script during run-time.
In order to modularize the script, library Files are added to the QTP Script. It contains variable declaration, Functions, Classes etc. They enable reusability that can be shared across test scripts. They are saved with an extenstion .vbs or .qfl
The Test Results Window gives us sufficient information to show the steps passed, failed etc. Results window opens automatically after execution of the test(as per default settings).
There are various GUI objects with which QTP interacts during the script execution. Hence it is important to know the basic methods for the key GUI objects using which we will be able to work on it effectively.
Sometimes, application under test may contain standard window object but are NOT recognized by QTP. Under these circumstances objects can be defined as virtual object(VO) of type button, link etc so that user actions can be simulated on the virtual objects during execution.
As such QTP doesn't provide any built-in support to connect to database, however using VBScript testers will be able to connect and interact with databases using ADODB objects
ADODB has 4 properties or methods with which we will be able to work with the databases.
XML is a markup language designed for how to store data that is in the form that both human and machine readable format. Using XML, data can also be easily exchanged between computer and database systems.
QTP scripts can execute only if the objects are present in the Object Repository. If the descriptions of the Objects are created using Descriptive programming when testers want to perform an operation on an object that is not present in the object repository.
QTP itself can be automated using the COM interface that is provided by Hp-QTP. Automation object model is a set of objects, methods, and properties that helps testers to control the configuration settings and execute the scripts using the QTP interface. The Key Configurations/actions that can be controlled are listed below but not limited to
A Framework defines a set of guidelines/best practices that enforces a set of standards which makes it easy to use for the end users to work with. There are different types of automation frameworks and the most common ones are listed below:
Keyword driven testing is a type of functional automation testing framework which also known as table-driven testing or action word based testing.
In Keyword-driven testing we use a table format, usually a spreadsheet, to define keywords or action words for each function that we would like to execute.
Data-driven testing is creation of test scripts where test data and/or output values are read from data files instead of using the same hard-coded values each time the test runs. This way testers can test how the application handles various inputs effectively. It can be any of the below data files.
Data Driven Testing can be best understood by the following diagram:
Hybrid Framework is a combination of Keyword driven and data Driven framework that can be best described using the following flow diagram.