Skip to main content

Automation Framework - Beyond Buzzword

1. What is Automation?

Controlling one application for another application.

2. What is Framework?

A structure which consists of all the building blocks for developing an application.

3. What is Automation Framework?

You are going to use the building block of structure to develop application which is going to control another application.

4. Background – Object Oriented

If you have done development in any OO programming language then you can easily understand the concept of Framework and Automation. Take a simple example of Calculator. Can we call it an automated tool? Yes it is. You know why, because it controls the simple and scientific calculations.
If you are asked to develop a program like calculator in any OO language, then you are going to make use of many pre-existing library, their methods, properties to accomplish your goal. Now these library or readymade utilities can be bundles in a framework and you just make use of that framework to execute your task.

5. Test Automation Framework

Come to the point and talk about automation framework in testing. Today a no. of testing tool is available in the market and I am going to discuss about one of the widely used tools for automation which is HP Mercury QTP. How you are going to develop an automation framework in QTP.
Well you have heard of Keyword driven and Data driven methods which is considered as an Automation Framework. But I am not in agreement with this view as they do not fulfill the requirement of an Automation framework as whole. It’s Ok that using above methods you can accomplish specific task as per your requirement and you can reuse it in a same application but you cannot make much of it in another application having different requirement. Then what is the use of such a framework, which cannot be extended to fulfill any task.
In next para, I am going to talk of a Framework which can be extended to fulfill any automation task in QTP. I would like to call this as XP Framework - the framework which is extendible in real terms.

6. Beyond Paradigm – XP Framework

I would explain the above framework taking a very simple example. In most of the application you will find a presentation layer, business layer & database layer. XP Framework (as I called) talk of extending existing utilities available with QTP to fulfill the above architecture.

6.1. Presentation Layer (PL) Framework

Develop a library which is going to take care of your presentation layer. Now you will say QTP has already taking care of it. I will ask you how many shared repository you are maintaining for 5 different application you are currently working on. You will say 5. Why 5? Why not a single library for maintaining the repository for all your 5 applications? Never ever think of it. No problem.
Develop a list of object in web-based and desktop based application. The list could include text box, label, list box, combo box, radio button, checkbox, command button, image etc.
For e.g. Consider a login page which has 4 controls, 2 Input Box and 2 command buttons.
When you record your script make use of above control in developing a common library which can be fit into any similar login page in different application.
Every control has some properties and it belong to some object class. You goal is to make use of property and develop procedure so that you can set the property of these controls at run time.
When you record an event on a particular control the tool generate script for your actions and then you start working on these generated script by modifying, making it reusable, modular etc. Great Job you are following Data Driven model. What if you are asked to test the same functionality in different applications with same control but different properties, event etc?
You start recording and again start modifying your script. Why not we focus on developing a Presentation framework which should be application independent?
For e.g. “Object (Property, Action/Event)”. Here Property & Action/Event refers to all the Property and Action/Event supported by the underlying object. Give more thought over it as this method is time taking but once developed must give a good ROI.

6.2. Business Layer (BL) Framework

You have developed a presentation layer framework, now how PL and BL is associated. PL is used for user activity or input. The user input via PL carries some functionality which is also a part of requirement and thus testing. How you test this business layer where you have to apply logical thinking?
Here comes the old logical blocks of If, Else. Take an example, if I have to test “Age of a person cannot be less than 13 years while creating an email account”. Think about what are the objects, actions and input linked with above functionality while testing.
We already generated the PL, now using PL, provide the input and verify that a proper error message get displayed when user is trying to provide an age which is less than 13 year old.
Creation of a reusable business layer is time taking and evolving. You always have to make note of most common business function across all applications. Business Functionality are not always the same, so you have to make logical business unit and then put all your observation for the business unit on ongoing basis and soon you will find that you have created a library of Business Unit which can easily be reused in matching applications carrying same business functionality.
If one is going to automate the above functionality in QTP, then s/he is going to record the above functionality alongwith the error message. Good, that is the right way but I am going to put that If…else block to make it more reliable. For e.g. first I am going to give the script name “AgeLessThan13YearsOld”. This way I can easily find out all the business related script and can run it at any regression cycle. 2 more things I am going to incorporate to make it more reusable. First the input of age and verification of message.
Make the script with 2 arguments, one is age which can be used as input in your script and other is the expected message which get verified with the actual message and the result get reported. This design will ensure that if in future business changed from age 13 to age 15, I just need to change my arguments in the script and nothing else.

6.3. Database Layer

The last layer is the database layer which store the information passed via the presentation layer, filtered through business layer. What you are going to verify in your database. If you are spending time in verifying the entered data in the database using QTP, I will say it useless. You can easily verify it by directly opening the database table.
For e.g. if you are testing a search page, then
You can check the total no. of records returned via a query should match with the results returned on PL.

7. QTP – Itself a framework – Shifting Paradigm

QTP is itself an automation framework which help user to fulfill automation task for testing. We are making use of various features of this framework and trying to develop another framework above oneJ.
What we are trying to do? We are trying to fulfill some business tasks of testing. We are developing script, modifying the script, making it reusable and numerous activities. These all are procedure and we are making use of QTP Framework.
The Automation Framework is an industry buzzword and nothing else.
The industry is calling below mentioned as framework and I am not in agreement with it:
 Test Script Modularity
 Test Library Architecture
 Data-Driven Testing
 Keyword-Driven or Table-Driven Testing
 Hybrid Test Automation

Why we call the above model as a Framework. We solve the business problem using above models in QTP or similar automation tool (which I am calling as an Automation Tool Framework.)
What I am talking may sound rubbish but I am talking on basics. Why we do not call MVC, N-tier and other architecture a framework? Why we call dot net as framework because we solve business problem using Dot Net Framework following some architecture which is reliable, maintainable etc.
Even the framework which I mentioned over here is just an extension of QTP Framework.

The above views are mine and you may or may not agree with it. The views and opinions give may or may not be useful for you in real time scenario.
Your views are most welcome.

Comments

Anonymous said…
Sachin

Your post is really good and informative but as we know that QTP is very popular and widely used and due to this lot of materials are available for it.
It will be really good if your site would initiate discussions on some open source testing tools or tools which are not widely used but they very good like "Test Complete".

It is mere a suggestion.

Thanks
Kundan
Makado said…
Thank you so much for your explanation of how to Build and Maintain Test Automation Framework in QTP. Since it is now clear that "Test Automation Framework" is an industry buzz word in the "basic" since, then I feel comfortable with my level of understanding of QTP and can be reassured that I have this experience.
Anonymous said…
Hi Sachin,

This is really good post. They way you comeup with framework will useful for many automation projects. This will speedup the scripting and reduces the maintainance. In near future we will see more applications of this.
Good job and keep it up.

Naresh Veeramachineni

Popular posts from this blog

Revolutionize software testing with AI! 🤖💻 Share your thoughts on ethical implications in the comments.

  As technology evolves, so too does the field of software testing. One exciting development in recent years is the use of AI (Artificial Intelligence) to automate repetitive tasks and improve testing accuracy. Through analyzing large amounts of data and identifying patterns, AI can help identify potential defects or vulnerabilities in software. AI-powered tools can also generate test cases and scenarios by simulating user behavior and input, allowing for more efficient and effective testing. In addition, machine learning algorithms can analyze and learn from past testing data, leading to better predictions and more streamlined testing. AI-powered tools can also help identify and prioritize critical bugs and defects, saving valuable time and effort in manual testing. But it's important to note that AI-powered testing is not a replacement for human testers. While AI can automate certain tasks and help identify potential issues, it's still necessary for human testers to provide a

Is AI taking over your job in software development and testing? 😱"

Are you a software developer or tester feeling threatened by the rise of AI in your industry? 😰 You're not alone. Many professionals in the field are concerned about the potential consequences of AI's integration into software development and testing. While some experts believe that AI can bring significant benefits to the industry, others worry that it could replace human expertise altogether. 🤔 AI algorithms can analyze massive amounts of data and automate many tasks, but they cannot replace the critical thinking and creativity of human beings. Additionally, there are ethical concerns associated with the use of AI in software development and testing. So, what can you do to ensure that you're not replaced by AI in your job? 💪 First, it's essential to recognize that AI is not a replacement for human expertise but rather a tool to augment it. Therefore, it's essential to learn how to work with AI-powered systems to increase your efficiency and productivity. Additi

HP Quality Center - Best Practices

1.Introduction Quality Center is a test management tool which provides very good features for managing both your manual and automated test cases. This paper highlights the best practices for managing your test cases. When you open Quality center, depending on your rights it display the below mentioned option in the sidebar: 1. Requirements 2. Test Plan 3. Test Lab 4. Defects 5. Dashboard 2.Requirements When you have assigned with the responsibility of developing your test cases in the quality center then you must be wondering where to start with. I am going to share my experience to overcome such a situation. You need to find the solution of some question before you start writing your test cases. 1. Is your requirement developed and available? 2. Is your requirement organized in a logical sequence? If answer to both of the above question is Yes, then you can start with Requirement option in the side bar. In case your requirement is under development, then you keep your