Designing the test framework? here are things you need to keep in mind.

Viral Patel
6 min readMay 4, 2021

--

Test Automation enables us to test software faster and efficiently

It reduces the workload from the test engineer to test repetitive and time-taking scenarios. and because of this, almost all companies are implementing automation testing.

Even some companies are aggressively targeting to achieve 100% automation. However, this could not be possible but you can understand that How businesses are understanding the value of test automation for ensuring the quality faster.

But the success of the Test automation projects depends on the

  • How easy to set up your test framework in a new machine?
  • How flexible your test framework to adopt the new structural changes?
  • How fast you can write a test script into the framework?
  • How easy to maintain and update the script into the framework?
  • How easy it for the new people to understand the framework and contribute to it?

This is the ultimate checklist that needs to be kept in mind while designing a test framework for the project.

For the regular interval, you need to validate the framework against this point and if the framework is missing or failing against this checklist, It will reduce your testing efficiency, make the job harder for the Test Engineer to maintain and run them regularly.

Let’s explore all the points and understand that why they are necessary…!!!

How easy to set up your test framework in a new machine?

While designing any framework just check that your framework should be easy to set up in a new machine without any error from the dependency or tools version

  • All the dependencies you are using should available publicly or if you are using the private dependencies or library, make sure that all the team members have the proper access
  • The Dependencies or libraries you are using should use the latest version or should update the version on regular time interval
  • In my recent project, one particular line of the code only compiles with Java8. so there is an explicit requirement to use java 8, now other dependencies are required for the new Java version or need to use the new java version features, that line of code became the bottleneck.
  • It’s better to have the setup instruction to be properly documented. With all the known issues and how to resolve that, this will save a lot of time for new test engineers to onboard.

How flexible your test framework to adopt the new structural changes?

The framework should be flexible which can adopt the new structural change like change the name of the directory or file. It should not be too dependant on the directory or file name which makes it even hard to introduce the new features into the framework.

Let’s consider one example, Many frameworks, use the directory path or file path for reading the config, and every single method has to declare the file name or path to read the config.

Now due to new features, the config file needs to change the file name or its a directory, which will break all the methods dependant on it. and engineers need to update paths or code in every single method to accommodate the new changes. This is just a single example for reference you will find a similar issue in your framework as well.

When you design the Framework, Make sure that there is a single function available to get the data required, so when you required you use that single function only, and when any kind of structure change happened, you need to change into that single method and not breaking anything.

How fast you can write a test script into the framework?

The main purpose of to design framework is that it enables the test engineer to write tests faster so the test engineer can utilize tests when needed.

I have seen that most of the frameworks are using the page object model but they don’t have any rule for creating a locator or relevant action methods. this will create chaos when multiple engineers are working on the same projects and repo. as every engineer uses their strategy for creating the page objects.

It’s also reducing the reusability of the methods as there is no proper page object strategy implemented and everybody creating their methods to handle the same function on the page.

This is frequently happening on big projects because there is no proper strategy and code structure standard for the page object designing.

This will ultimately result in slower test development as test engineers need to write code for everything from page objects to test development.

So, When you design the framework, Just keep in mind that you also need to define the coding standard for the page object like

  • How many locators should be created?
  • Every locator has the relevant action methods like if there is an XPath for the input box, then all the methods like entering text, clear, click, move to textbox should be available to when test engineer write the code they can quickly pick up rather than creating a new.

From my perspective, In Any Automation Project, There is one engineer who only needs to focus on creating and maintaining the page object required by the test create engineer.

How easy to maintain and update the script into the framework?

When any test automation project start, the main focus is to design the framework which meets the current requirement and start developing the test. there is no focus on how to keep the framework maintainable for the long run.

In many cases, Test engineer are keep adding the various method and functionality which is not required or less required, most of the time code is not optimized but just a copy-paste from the online solutions.

There is also a common practice that the framework designed for one project will be used for another project, also leaving many functions or methods which are not use now.

Even many cases, Framework is using the concept of the programing language which is not required at all, this approach only increases the complexity of the framework, the more complex the framework, it’s very hard to maintain.

The framework must be reviewed at regular interval and remove the unnecessary functions which are not in use, also need to work that how the existing feature should achieve while less line of code.

How easy it for the new people to understand the framework and contribute to it?

When you onboard someone to write the test, you want them to quickly understand the structure and start developing test cases, but is your framework is allowing this ??

Most of the framework doesn’t have any kind of documentation which can explain the concepts of the framework, how it structured, and from where you can start to write the test cases.

Most of the time colleague explain the small part of the framework when you have doubt and based on the little knowledge you try to develop the script, but without knowledge about the framework, you are not utilizing the full potentials of the framework feature, some time you duplicate the same of the available feature.

Like in one of my previous projects, we have one test where we are reading otp for that we are using the open inbox service like mailinator for the getting mail of OTP and read from it. We have made the methods that will open the mail and read the otp from the user mail

When the new engineer joins the team, he needs to use the same feature for some of the scenarios he is working on, As he has not a full understanding of the framework features, he creates a similar feature with another service call Yopmail. this has duplicated the approaches and also waste the time to develop the feature which is available already.

This kind of situation happened when the framework is hard to understand or complex, which discourages the test engineer to explore the framework completely.

If the framework is used by many people must prepare the structural diagram of the framework which helps the new tester to understand how it is configured and also prepare a document regarding the features available in the framework.

This will help everybody to understand the framework and they will utilize its full potentials which enable to write strong test and ultimately resulted in faster testing and faster release of the feature.

I have prepared this checklist based on my experience to design test framework using various tools and technologies based on the project requirement, if you need any kind of help in Framework designing or Test Automation, Feel free to connect me or ask a question on my forum or Join my group where I’m daily sharing an update on topics related to testing

Originally published at https://www.testerin.me on May 4, 2021.

--

--

Viral Patel
Viral Patel

Written by Viral Patel

Co Founder at QAble.io #Automation Tester,#Selenium Developing a New Automation tools: Connect Me for more details about it

No responses yet