Let’s suppose that you’ve been asked by your boss to write several test scripts using QTP. In your capacity as an engineer for automation, what are the tasks you’d like to accomplish in this project? The most important aspect is making sure that the testing program perform the job it is supposed to. In addition, wouldn’t like to have your code simple to comprehend, can be reused, requires minimal maintenance and is able to be expanded? These are the qualities that if you’ve got can make your life simpler. What can you do to achieve all of these? This is possible with the right Test Automation Framework.
What is QTP Framework Mean?
QTP Framework, or in general, a Test Automation Framework, are some guidelines you can use when writing scripts to get the above-mentioned ‘desired’ outcomes. The guidelines could be anything like –
Coding standards for example, variables names must start with the name of the variable (eg. flFlag, boolVar) Function names should begin with the letter fn (eg. fnCalculateSum).
The format on your sheet of information, and how your workbooks and individual sheets that are organized.
What folder structure is necessary to follow to save test scripts, libraries that are reused and object repositories. Also, what is the best way to store results of tests.
What should the run’s results be stored and how should they be displayed.
How all team members should have access to the shared libraries, repositories, and how they should maintain the shared repositories and libraries.
And numerous others..
The following guidelines will ensure that the work is executed in a uniform method that would create a framework that will give you all the advantages you’ve set out to achieve.
It is important to note that these are only guidelines and not rules that are compulsory. Even if you don’t adhere to these guidelines, you’ll be able complete the most crucial task i.e. testing the scripts to find out whether the application is functioning well or not. It is only a matter of time before you may have to spend lots of time scripting (if there’s no reuse of the code) and maintaining the application could end up being quite a challenge.
The most important features of a Test Automation Framework
The following are the functions which should be found in an automation framework that is well-designed.
A) The framework must be designed in as to help in maximizing the possibility of reuse.
B) Test scripts must be easy to read and maintain.
C) The framework must be constructed in that all of the components like test cases and function libraries, objects repositories, data sheets tests and configuration files are organized into separate folders. This will help end users to access the framework with ease.
(d) Data parameterization must be used to ensure that the code is separate from the data, to ensure that the same code can be used to handle different data sets.
(e) Test results should be logical and simple to comprehend. You may also provide detailed and high-level test results on their own.
F) Effective error handling techniques must be utilized. It is also possible to provide examples of unsuccessful test cases.
G) If tests are executed using batch, the failure of one test script won’t impact the execution of remaining test scripts within the batch.
H) You may as well write QTP AOM code using VBScript that can be used as the base for the implementation of tests.
I) The framework can include email (and in the event that SMS is required, email) capabilities so that results of the test are sent to the participants.
In addition to these features it is possible to add additional features that are based on your preferences.
Frameworks that are used in QTP
Below are the various types of QTP Frameworks you can make use of when writing test scripts.
1.) Linear Framework in QTP The most basic framework in which it is possible to write the code exactly as it is. This means that with this method, you write all the steps sequentially in a linear way.
2.) QTP Functional Decomposition Framework This framework lets you compose the entire code in different functions and then call these functions whenever you need. These functions can be reused and not.
3.) QTP Data Driven Framework In this framework, your data is kept distinct to the program, and is best to use Excel sheets. This allows you to execute the same code for several types of data.
4.) Keyword Driven Framework in QTP This type of QTP Framework you are able to define different keywords and assign various actions to these keywords. In the event that QTP encounters a specific framework, it will perform the actions associated with that framework. Click here https://www.ilariasarmiento.it/