You can cross a busy road of the street just by rushing from one side to the other side without following any rules. But that can be dangerous for you, chances of you being hit by a car or any other vehicles are very high. But at the same time, if you follow the simple traffic rules to look both the sides of the road before crossing it can save you from falling victims of road accidents. Isn’t it?
Similarly, you can perform the automation testing without implementing any framework, just buy an automation tool and start doing the testing. That’s fine, no issues with that. But when you implement a perfect framework and follow its guidelines you will get the most required beneficial outcomes from it.
Frameworks are a set of guidelines which can be ignored, but when that followed you will reap the benefits from it.
Frameworks consists of guidelines, concepts, best practices, established processes, well-defined coding standards, object repositories process, better handling of test data, proven reporting mechanism etc., to perfectly performing our work and get the better beneficial outcomes from it.
An automation framework provides us the required environment to create and execute our automation test scripts, better error handling, reduce script maintenance cost by organizing the automation scripts efficiently which can be reused when required.
Let’s discuss some of the benefits you will get by adopting a framework while automating our applications.
There are different types of frameworks having distinct guidelines to follow. We can adopt a framework based upon our requirements.
This framework focuses on module or functions based scripting. We need to write separate scripts for each of the module under test, and by integrating those scripts, we will get larger scripts for more than one module.
Advantages of this framework is, it avoids the inter dependencies of scripts. So, in case of any changes the script representing that module needs to be updated, leaving the other scripts untouched. Thus it provides stability and reduces rework cost.
The major issues with this framework is with the test data, as we embedded the test data into module wise scripts , so in case of data changes that script also required to be updated accordingly.
As we know there are some common steps which can be used across the modules. We can write functions with those common steps and keep them in a shared library. So, when required we can call that function from the library instead of writing those common steps again.
For example, we can write a function with common steps required for logging an application and keep that in library. So, whenever similar login screen is required to be tested in the application, we can simply call that function.
The disadvantage of this framework is that, in case the shared function is wrongly written, then that have an cascading affect into other scripts as well.
Let’s discuss a scenario; you are in an education domain project where you need to test large number of student data. So, it is obvious that you also need to add new data and drop some old data to test various scenarios.
In that case, isn’t it a tough job to insert those large student data in each scripts and again in case of changes, you need to edit all those scripts? Just imagine the amount of the work required to do all these activities.
That’s where the data driven framework comes to your rescue. Using the framework, we can store the test data in a separate excel, CSV or xml files, and later call them multiple times using the key by invoking calling function of shared library within the script.
While this framework increases flexibility and maintainability, complication of the process requires extra effort and expertise in programming language to create the scripts.
This is an extension of the data driven framework, but it also stores the keywords along with certain set of codes in a table. So when those keywords, for example login, clickbutton, verifyLink etc., are required we can simply invoke them independently.
As the keywords and the test data are stored in a table, it is also called as Table driven Framework. This framework requires less scripting knowledge but to create the keyword mechanism requires programming knowledge.
This framework is a combination of two or more above mentioned frameworks to leverage the required benefits from them. You can adopt the combinations of Data-Driven framework with Keyword driven framework and if required, you can add the common library testing framework.
The sole purpose is to get the most desirable benefits by combining multiple frameworks.
This framework focuses on developing and testing the business specifications using various tools like cucumber, jbehave etc., and following the continuous integration approach using Jenkins and Bamboo.
All the phases from writing stories, mapping and configuring, executing and viewing the reports, can be performed using various tools, hence not necessary to be an expert in programming language.