An Automation Framework is collection of assumptions,concepts and practices you bring in while developing the automation project, so it helps in constituting a work platform or support for automated testing.It would be great, if the framework is application independent.
If you look into the any existing framework,it will be block of function libraries for reporting , error handling , and driver scripts.So the test automation framework is an execution environment for automated tests. It is the overall system in which our tests will be automated.
What is the advantage of using framework?
The straight forward one is easy maintenance and reusable.
To support the above point let us consider an example,your are automating login page functionality for Gmail and later you have to automate WordPress login page. Manual step for this will be entering Username, Password and clicking Login button in both case.The same can be achieved on automation by capturing these objects and performing actions on them with available methods(read OOPS article to know the basics).
We may need to perform some validation and error handling before performing actions on these objects,like whether the object exist in the page or is it enabled? Also we might need to report the results using a reporting function. So If you look we have to create the same piece of code to perform these tasks both in Gmail and WordPress login page.Can we make them common?
To make them common first figure out what are all common between them and what are unique for them.All the error handling,validations, and report generation will be common to both,but objects are different because they are different application.Also methods we perform on those depends on the functionality .
Create all those error handling,validations ,reporting script as function libraries,to which you pass objects and methods as parameter.We got the solution 🙂 . But how to pass these arguments to those functions? This can be achieved by using an excel sheet or Database or even XML as input data. Now you need a script to read those data(that is the driver) and based on the data, appropriate functions will be executed. Generally the input data will have the Objects and Methods
Now both Gmail or WordPress can use the same scripts, now just create object repository and an input data sheet for each application. Also when there is change to test case or if you want to add new test case, then only the input data sheet needs to be updated, no need to update the scripts making maintenance easier.
That’s it , application independent framework is ready 🙂
Will come up with another article on types of framework and their Pros and Cons soon.
Click this link to get read more about automation framework
Click this link to understand different types of framework
I have explained basics of automation framework.
Automation Framework is practice of keeping all reusable, common components in one place making them as the platform to execute your automation scripts, all application specific data are passed as arguments to those functions.