• info@helpingtesters.com
  • helpingtesters

Learn about Automation Framework

September 5, 2016
Automation Framework, automation testing

‘Framework’ is a term that is synonymous with ‘organization’ and ‘supporting structure’. In software, automation framework is a system in which test cases are executed efficiently. It forms the foundation of efficient Automation Framework replay and maintenance.

What constitutes an automation framework?

Automationframework

Test Scripts

Test scripts are a sequential execution of actions on the application under test. These form the limbs for automation frameworks. A good framework needs to provide some kind of distinction between the different types of test scripts.

The simplest classification is between new functionality, regression, sanity, etc. Some release-wise classification would also become essential in time. Other use cases for automation include differentiating between API testing (Application programming interface), User Interface testing, etc.

 Object Storage

UI automation is typically how every organization open their automation accounts. With UI Automation Framework comes the necessity of managing the UI objects which are used in the test scripts.

In less extensible frameworks, the objects are directly stored in code. The disadvantages of this method are evident.

  • There is no provision to reuse object definitions if the same objects are used in multiple test scripts.
  • If the object definition changes, one needs to dig through hundreds of lines of code to change it in the code. Multiple scripts which use the same objects would also need to be changed.
  • Maintenance cost gets higher in time

By the same logic, one mark of a mature framework is the object definitions kept separated from the flow.

 Utility Layer

The Utility Layer is the layer which interacts directly with the application under test. This is a level of abstraction in the code logic where generic code can be maintained away from the application-dependent code.

In UI automation, the utility layer has generic actions like ‘Click’, ‘Verify’, ‘Type’ etc. The implementation of these actions depends on the Automation Framework tool being used.

Advantages of having a utility layer include:

  • The same automation framework can be used for more than one application.
  • Creating this set of utility actions being a one-time activity, realizing the return on investment gets one step closer as soon as this activity is done.
  • Maintenance is close to nothing on this layer as it is possible to define and create all the actions beforehand.

 Business Logic Layer

The business logic layer has all the logic relating to the business flows of the application. This is the layer which is application-specific for a framework.

Advantages of having a business logic layer:

  • If the same framework is used for multiple applications, it is easy to start defining the differentiation from this layer onwards.
  • If the core functionality of application changes, this is the only layer which would need updates.
  • For complex applications, a review process can be kept from the product owner or business analysis for just this layer alone.

 Driver Script(s)

What is the glue that binds all the above together? A driver script or logic which basically does the linking of the different components of the Automation Framework together.

This layer, though simplistic in a definition is important because of the implications below.

  • Performance aspects– If the driver logic is not light-weight and is slow, it weighs down all the different components. In effect, it weighs down the entire framework performance.
  • Maintenance– Setting this driver script is a one-time activity unless a major revamp of the flow is required, in which case the framework definition itself is any way changed.

 Reporting Structure

Once automated cases replay and compute their results, one had to look at what format the report needs to be generated. Some considerations to be kept in mind are:

  • Lightweight reports– Report numbers are going to be growing exponentially and within weeks, the size could become unmanageable. This vision needs to be clear while defining what needs to go into every report.
  • Multiple numbers of reports– Different reports have different audiences. It is important to recognize and accept this so that the necessary thought process can be put in action in the framework design stage.
  • Data analytics– Analyzing reports in a mature Automation Framework system can give indicators of where the framework is most effective in identifying defects, where the system breaks more often in regression, which are all the cases which need not be replayed daily, etc.

 Interfacing to other tools

A framework is not complete without hooks or provisions to interface with other tools.

  • Test management tools– Interfacing a framework with a test management system gives an excellent advantage to look at automation in the overall scheme of things. It is an invaluable asset for measuring how effective test automation is in the testing lifecycle of the product.
  • Bug tracking tools– The ideal situation where an automation case would like to get to is a direct relation between a defect and an automation case failure. When automation gets to this state, it makes sense to directly raise defects on defect failure. This requires interfacing between automation framework and bug tracking tools.
  • Data Analysis Tools– Connecting Automation Framework reports and data analytic tools give the ability to take management decisions based on automation runs.

Likewise, hooks can be enabled for any interface which would provide business value.The mark of a good framework is constant evolution along with the changes in the industry.As long as the initial creation of an automation framework is done keeping this in mind, Automation Framework would be able to cope with the times and reap unbelievable benefits.

 

About the author

Aarti Suresh author

Aarti has about 9 years experience in manual and automation testing. Although her primary work area is automation she also enjoys manual testing from time to time.

Leave a Reply

Your email address will not be published.