Saturday, October 31, 2009

What are Automation Frameworks?

In Simple terms, one can easily define an automation framework as “a platform for conducting automated test design and execution”. The automation framework can be considered as the ground where a tester designs his test case in the form of scripts, and then runs the script or a set of scripts.

There are a number of types of frameworks that we normally come to hear about. Like the common Data-Driven frameworks, Keyword driven frameworks, Hybrid Frameworks, Test Modularity Frameworks etc. What are these frameworks anyway? Why do we have such a number of types of frameworks anyway? What is the best framework that we can use? These might be some among the questions that come into your mind now. Let’s try to solve the questions.

All the types of frameworks, that we come to hear, are basically the way in which one wants to get his automated tests executed. Let me go into detail with a simple example of the windows calculator application.

If the test case is to check 10 + 10 = 20, this could be automated in different ways. 

  • Create an automated script to press “10 + 10 =” – This could be defined as the data driven way. Here the script directly reads the input value as 10 and does the calculation and checks the outputs.
  • Create a script to read input values from a file and do the processing – This is also a data driven method of automation. Here, although the data is read from a file, the script is created to perform an addition task.
  • Create functions to press buttons on calculator and pass the values as object names – This is the Keyword Driven way of automation. Here the final script is not restricted to an addition task. It could be used in other cases as well.
From the example above, we can identify that we can create and use different types of frameworks, according to our outlook of the application and method that needed to be followed.

When comparing different frameworks, the keyword driven framework has an upper hand over the other types of framework, because of its ease of use, reusability, maintainability and other uses. Considering the calculator example shown above itself, if we proceed with the data driven approach, there is a limitation of the script being used only for addition test. For conducting a substraction test, one needs to create another script. But this certainly has an advantage in the fact of repeatability. The script can execute at a faster pace than the one created in the Keyword driven approach, when there is a huge amount of data that needs to be used for testing. Here the data is the one which drives the framework. Thus, the data driven approach makes the framework application dependent. This could not be used across applications. It is meant for a specific application only.

But think about the keyword driven framework, where we create and call function to click certain object. In this case, the same function could be re-used for substraction, division as well as other functionalities. Thus, a keyword driven framework could be reused for various functionalities as well as different applications as well. Thus the application/software dependency is removed from automation, when keyword driven approach is adopted.

I will come up with more light on different frameworks and examples in the coming posts.

1 comment: