Hybrid Test Automation Framework

Introduction: Test Automation Framework

A framework in general is a supporting structure that incorporates combination of protocols or standards followed as a whole to leverage benefits wherever it is used. The same definition applies to a test automation framework as well. It acts as a support structure to the automated test scripts. So, a test automation framework is a set of guidelines or rules used to design and create test cases. A framework comprises of various practices and tools that help in more efficient testing and achieve desired result. It is a conceptual part of test automation that helps testers to use resources more efficiently.

The guidelines or rules that make up a framework can include a suitable combination of coding standards, processes, test data handling methods, project hierarchies, reporting mechanism, modularity etc. The framework facilitates in well organized and systematic design and development of automated test scripts for the application under test and ensures reliable analysis of issues.

In this article we will see the importance of hybrid test automation framework. Also, there are lot of situations where workflows are scattered, and users must use computer/mobile devices/handheld devices to access different functionalities. This gives rise to have a container framework that can-do end to end testing and can accommodate automation of hybrid workflows. We will see how Brainbox has developed a test automation framework that can be used to perform end to end testing of both web and mobile applications.

Pic1: End to end mobile and web application testing

Importance of Automation Framework in Software Testing

Test automation has become a fundamental part of Agile and DevOps practices. They support effective and rigorous functional testing by significantly reducing testing time and test coverage. Since a test automation framework is a set of rules to create automated tests, it ensures a consistant and reliable test automation across an organization and increases value of the whole process.

The need of a test framework increases when multiple people are working on different modules of the same project. Having a framework streamlines the testing process and everyone in the team can follow the same standard approach defined by the framework.

A testing framework is always application independent, meaning it is a general skeleton of the project that can be used to test any application. And hence the framework should be scalable and maintainable.

Below are some of the key advantages that a test automation framework provides,

  • Improved test efficiency
  • Lower maintenance costs
  • Minimal manual intervention
  • Maximum test coverage
  • Reusability of code

Different types of Test Automation Frameworks

Each automation framework has its own architecture, advantages, and disadvantages. Some of the frameworks are:

  • Linear Automation Framework
  • Modular Driven Framework
  • Behaviour Driven framework
  • Data-Driven Framework
  • Keyword-Driven Framework
  • Hybrid Testing Framework

Hybrid Test Automation Framework

A hybrid framework is a technique where in we can use of any of combination of two or more automation frameworks mentioned above. As this is a hybrid framework, it has been based on the combination of many types of end-to-end testing approaches.

Since Hybrid framework is a combination of other frameworks, it incorporates the better parts of every approach mitigating the weaknesses of different frameworks. A Hybrid Framework can be created and used to automate any application. This will reduce the man-hours spent in scripting the automation code, since a framework once created can be used to automate multiple applications. Similarly, frameworks can be created according to the project needs and used for automation purposes.

Business case: Brainbox Test Automation Framework

At Brainbox, we have developed a hybrid test automation framework for end to end application testing of web and mobile android platforms. This kind of container framework will help to solve the problems where there is a need to do an end to end testing of work flows scattered across web and mobile platforms. The framework uses both keyword driven approach and data driven approach where the Test Cases and Test Steps can be defined via simple English specified in an excel document.

This framework uses Python as a programming language and its Pytest framework to write test scripts. Web application testing tool used is Selenium WebDriver and for Mobile applications, it is Appium.

Pic 2: Test Cases

The above template that is used for creation of test cases. The Test case scenario is represented using test case name, description and an execute parameter which indicates if the test case needs to be executed or not.

Pic 3: Test Steps

Each test case is linked to a testcase sheet which will give you detailed test steps for that test case as shown in the above picture. Test description represents user defined functions in english language and test input values are the data inputs to the application. We are using behavioral driven development kind of implemetation using Excel and also driving the data through excel.

Pic 4: Brainbox Framework components

Our framework architecture has following components:

  • TestCases:

Test Cases are in an Excel written in simple English.

  • Test Case Generation:

Taking the test case from excel, Test case Generation component converts into python script to create pytests and execute them.

  • Reusable Libraries:

There are Core libraries and configurations that are generic and contains all the core functionalities of the framework.

  • Object Repository:

This component has locators for all the UI element of an application.

  • Business Functions:

This component contains the actual implementation of functions for the application under test.

  • Reporting:

Framework is also integrated with Allure reporting, that gives a detailed analysis of the Test Case executed. There is also a functionality where a screenshot is taken when the test fails, to help with further analysis.

Advantages

  • The time taken to run the test designed with a hybrid framework is relatively less compared to other frameworks.
  • This can be used when we need all the test cases and inputs that are associated with a test case, in the same test suite.
  • Provides high code re-usability.
  • Independent of Application Under Test, the same framework can be used for other AUTs.
  • A Variety of Test Scenarios can be executed by just varying the Test Data in the External Data File.

Disadvantages

  • Clear knowledge on the combining different framework is required.
  • Tests are fully scripted in a Hybrid Testing Framework thus increases the automation effort.

 Summary

The process of creating Automation framework requires detailed planning and extreme efforts. To achieve desirable features, one should design a robust and reliable framework. Such type of framework can then be used for any kind of application with minimum changes in any type of organization who requires automation testing. At Brainbox, we have designed and developed one such framework that can be used to test both Web and Mobile applications.

Contact us at sales@brainbox.consulting for more information and we would be happy to assist you with testing related services.