“How comfortable are you designing an Automation Framework from scratch?” – The very first interview question for a QA/Testing job opportunity now-a-days. What should I say? I am really good at Functional Testing? Nah! There is no space for manual testers. You HAVE TO start learning Automation. And it’s not just about Automation scripting, interviews are more driven towards programming & building an automation framework. So here I am penning down my answers to all those automation interviews in a series of Automation Framework focused blogs. It’s high time, really!
It started with automation and now everything revolves around automation framework. Why so much fuss? What’s so great about automation frameworks? Why is everybody asking about automation framework development? Why do we need it at the first place? What are the benefits organizations tend to achieve using frameworks? Oh! Before that, if you are completely new to the world of frameworks – this article should help you in understanding ‘What is Automation Framework’.
What is Automation Framework?
Software Testing is a multi-component activity, i.e. different items. What are the most common components involved in test automation? Yeah! The application-under-test, Test Automation tool, Test Management Tool (where the test cases & screenshots are stored), Test environment, Application Objects, Application modules, Test Data, Functions, Test script, Results, etc. Now how do you think these different components interact to successfully test the application, automatically? How do you modularize application flows into different functions? How do you identify & organize application objects? Where is the Test data stored? How is it accessed? From where do you run the test scripts? Automation tool or Test Management tool? Which all screenshots & logs are captured? & in which format? How do you report the test execution results? Yeah! There has to be a set of guidelines driving these rules, right? That’s what we call it a Test Automation Framework – a set of protocols, standards and guidelines (programmed) that sets the rules of testing a specific product – how different automation components will interact to run automation scripts & capture the results in a coherent & beneficial manner. I.e. how these different components (building blocks) need to be assembled.
A simple understanding – determine the common steps and group them into functions under a library and call those functions in the test scripts whenever required. Example – Application login functionality.
Why do we need Automation Framework?
Why do we need a framework? Can’t we just code & run? Simple, right? Nah! Assuming a 100 Page website with numerous Objects and functionalities, how will you code directly? Every time identify the same object in different flows? Or where do you keep the Test data? Every developer scripting in his/her own approach? Keeping data in their local systems? What about the reports? Yeah! To avoid chaos, everything needs a process, some guidelines & procedures to follow. Nothing different with Test Automation here…
Benefits of Test Automation Framework
These elements offer clues to understanding why test automation frameworks are critical to today’s modern software development methods.
Ease of scripting: Every programmer has their own coding style. With multiple Testers in a team, having an automation framework in place ensures consistent coding and that best practices are followed to a certain level. Standard scripting will result in team consistency during test library design and prevent individuals from following their own coding standards, thus avoiding duplicate coding. It helps to streamline testing projects that involve a group of testers working on multiple features of an application.
Scalable: Whether multiple web pages are being added or Objects or data, a good automation framework design is scalable when the need arises. A framework should be much easier to extend to larger projects.
Modularity: The biggest advantage of using an automation framework. What if you need to write (or copy paste) the login code for every test case within every test script? Lame, right? Exactly. Automation framework ensures that the mountain task is broken down to manageable rocks which can then be re-used whenever required.
Understand-ability: How will you transition the automation implementation to a newbie? Nah! Explaining each & every Test script would be too time consuming & not worth the effort. Having an automation framework in place it is quick to transition (or understand) the overall architecture & bring people up-to-speed.
Re-usability: Another major benefit of implementing an automation framework. It introduces a great degree of re-usability. Common library files can be reused when required, no need to develop them every time. Modularity allows testers to re-use common modules in different scripts to avoid unnecessary & redundant tasks.
Cost & Maintenance: The biggest hurdle to successful automation is ‘maintenance’. You cannot ask client not to make any further changes to the requirement. And then to developers for subsequent changes to the application. A well designed automation framework helps in maintaining the code in light of common changes like Test data, Page Objects, Reporting structure, etc.
Maximum coverage: A framework allows us to maintain a good range of Test data, i.e. coverage in turn.
Better error handling: What if the script fails without any reason? A good automation framework helps us catch different recovery scenarios and handle them properly.
Minimal manual intervention: The very reason for automation existence. You need not input test data or run test scripts manually and then keep monitoring the execution. Automation framework can take care of mundane & redundant manual tasks.
Easy Reporting: The reporting module within framework can handle all the report requirements. Any changes, if required, can be incorporated in the same module for easy & efficient reporting. A framework allows for user friendly interface and reporting options.
Segregation: A framework helps segregate the test script logic and the corresponding test data. The Test data can be stored into an external database like property files, xml files, excel files, text files, CSV files, ODBC repositories etc.
Test configuration: Test suites covering different application modules (or functionalities) can be configured easily using an automation framework.
Continuous integration: An automation framework helps in today’s time of continuous integration.
Debugging is easy if you have a framework in place instead of haphazard collection of Test scripts & Test data.
Why Test Automation Frameworks are critical
There is a divergent range of Automation Frameworks available now days varying with respect to application-under-test, the ease of maintenance or re-usability, etc. Every project, application and client needs are different – so it’s always better to design/build your own best suitable automation framework. Utilizing a framework for automated testing will increase a team’s test speed and efficiency, improve test accuracy, and will reduce test maintenance costs as well as lower risks. They are essential to an efficient automated testing process. Test automation is a fundamental part of Agile. Various core practices of Agile, such as Continuous Integration (CI), Continuous Delivery, Test-Driven Development (TDD), and Behavior-Driven Development (BDD) rely on the efficiency and reliability of test automation frameworks. Some of these benefits take time to develop but they’re all achievable. For most companies the effort is well worth it.
Note: With this article we have started learning Automation Framework Design. Pitch in & help fellow Testers by providing your valuable inputs in the comments section below…