Automation Frameworks and How to Build a Simple One

An automation framework is a way to organize your code in meaningful manner so that any person who is working with you can understand what each file contains.

Automation frameworks differ based on how you organize your code – it can be organized based on your data, so that any person who wants to use or edit data files such as an excel sheet can do so easily. These types of frameworks are known as data-driven frameworks.

Keyword-driven frameworks are those which can be written with keyword functions such as: Login, ClickButton, SearchList etc. These enable automation engineers to work within the framework easily, without ambiguity in function or code.

The combination of the above is called a Hybrid framework. There are some other frameworks which are named according to their usage such as Modular frameworks, structural frameworks etc.

Long story short, a framework is a way to organize your complex code logic in a more meaningful way to make life easier.

This can result in many advantages such as:

  • Easily understandable code.
  • Code that is easy to debug.
  • Rapid development of code.
  • Less error prone code.

Automation frameworks are developed during the initial stage of any automation project. But, as we know, the initial phase of automation will not contain all the final project features. These will be added to the framework incrementally, hence we will start with small steps known as Folder structures. These dictate where we are going to place our codes within the folder. The folders in this structure are given clear and meaningful names such as “Utilities”, “Core” and “Test Data”.

Once we have the folder structure in place, we can place the code files within those folders. The folder structures are common in any framework or automation testing tool.

The next step focuses on the “Reusability” of the code we write. Starting with the first iteration, the code should be written with the intention of future use. Ideally, the code can be reused by the team with few or no changes.

Similarly, the code should also be “Generic” meaning the code should be compatible with more than one application. Since you are investing a lot of time in your framework design and development, tomorrow your company can come up with a new plan and can ask you to automate application B using the process you used when automating application A. If you have written your framework specifically for application A, then you must re-write your code for Application B. Lesson of the story— try to avoid writing code specific to a particular application. Of course, there are cases where you must write code for a particular application. In these cases, try to isolate the application specific code in your framework and make it more visible so that anybody working in the framework can understand that it’s only relevant to that application and not common to the whole framework.

Code written for automation must contain clear comments that include the description of the code (which can include the actual functionality of the code) and a specified return type. The latter should be familiar to any programmer since automation test engineers are no different from programmers.

Above is a basic structure of how your framework should look, as every framework or design has its own structure, which can best understood by pictorial representation.

As you can see in the diagram, the framework has just 3 layers, but you can increase the layers of abstraction in such a way that it can have between 3 and 10 layers. But the number of layers depends on your needs and the complexity of your automation framework.

The theory of framework layering is this: The more layers of abstraction you create, the more efficient your framework will be.

This was just an introduction to automation frameworks but I hope you got a basic idea of what they are all about.

What is a test automation framework?

A test automation framework is a set of guidelines like coding standards, test-data handling, object repository treatment etc., which when followed during automation scripting, produce beneficial outcomes like increased code re-usability, higher portability, reduced script maintenance costs, etc.

These are just guidelines and not rules; they are not mandatory and you can still script without following them but you may miss out on the advantages of having a framework.

Ten steps for test automation framework methodology:
  • Identify the scope of testing: Company oriented, Product oriented, Project Oriented, etc.
  • Identify the needs of testing: identify types of testing e.g. FT, Web Services, etc. and applications / modules to be tested.
  • Identify the requirements of testing: find out the nature of your requirements, identify types of actions for each requirement identify high priority requirements.
  • Evaluate the test automation tool: evaluation checklist, identify the candidate tools available in the market, sample run, rate & select the tools, implementation, and training.
  • Identify the actions to be automated: Actions, Validations, and requirements supported by the tool design of the test automation framework: framework guidelines, validations, actions involved, systems involved, tool extensibility support, customs messages, and UML documentation.
  • Design of the input data bank: types of input files, categorization, and design of the file prototypes.
  • Develop the automation framework: development of script based upon framework design, driver scripts, worker scripts, record / playback, screen / window / transaction, action / keyword & data driven.
  • Population of input data bank: different types of data input, populate data from different data sources, manual input of data and parent – child data hierarchy.
  • Configuration of the schedulers: Identify scheduler requirements and configure the schedulers.
Karthik KK
Karthik has been working as an Automation Test Engineer, Architect and Consultant for the past 7 years. He has done work for many different companies and uses tools such as QTP, Selenium, Visual Studio, Test Complete, and Ranorex.

The Related Post

Introduction Many executives have some very basic questions about Software Testing. These questions address the elements of quality (customer satisfaction) and money (spending the least amount of money to prevent future loss). The basic questions that executive have about Software Testing include: Why care about and spend money on testing? Why should testing be treated ...
For those that are new to test automation, it can look like a daunting task to undertake For those who are new to Automation, it can look like a daunting task to undertake, but it only seems that way. If we unpack it and pinpoint the fundamentals, we can have the formula for the desired ...
The guide for CUI Automated Testing strategies, including chatbot testing and voice app testing. In the Software Testing industry, trends come and go that shape the future of testing. From Automation in Agile, to the DevOps era we are now in, trends are what evolve and improve our testing processes and ideologies. Currently, many researchers ...
Source: From I.M.Testy (BJ Rollison’s blog) I just finished reading Implementing Automated Software Testing by E.Dustin, T. Garrett, and B. Gauf and overall this is a good read providing some well thought out arguments for beginning an automation project, and provides strategic perspectives to manage a test automation project. The first chapter made several excellent ...
LogiGear Magazine – March 2011 – The Agile Test Automation Issue
Looking for a solution to test your voice apps across devices and platforms? Whether you’re new or experienced in testing voice apps such as Alexa skill or Google Home actions, this article will give you a holistic view of the challenges of executing software testing for voice-based apps. It also explores some of the basic ...
What is the Automation ROI ticker? The LogiGear Automation Return on Investment (ROI) ticker, the set of colored numbers that you see above the page, shows how much money we presumably save our customers over time by employing test automation as compared to doing those same tests manually, both at the design and execution level.
5 roadblocks in vehicular autonomy that complicate Software Testing Experts in the field have previously referred to air travel as somewhat of a gold standard for autonomous vehicle safety, but after Boeing’s two tragedies, that analogy can no longer be used when talking about self-driving cars. This was after Boeing’s 737 MAX Jets have found ...
With the new year just around the corner, here’s a look at the Test Automation trends that have the potential to dominate. DevOps is being relied upon more than ever. With there being strong Market Drivers for the adoption of DevOps, the need for Test Automation has also never been greater. But what’s next after ...
The challenges with any automation effort is to know your capability. I’ve seen too many automation efforts begin and end with a tool decision. Generally these tools are very complex pieces of software that do many more things then we would ever use in our normal everyday testing. It even adds more misery to the ...
Introduction A characteristic of data warehouse (DW) development is the frequent release of high-quality data for user feedback and acceptance. At the end of each iteration of DW ETLs (Extract-Transform-Load), data tables are expected to be of sufficient quality for the next ETL phase. This objective requires a unique approach to quality assurance methods and ...
I feel like I’ve spent most of my career learning how to write good automated tests in an Agile environment. When I downloaded JUnit in the year 2000 it didn’t take long before I was hooked – unit tests for everything in sight. That gratifying green bar is near-instant feedback that everything is going as ...

Leave a Reply

Your email address will not be published.

Stay in the loop with the lastest
software testing news

Subscribe