Let’s take a simple example to understand what is Test Automation Framework. How do you think Indian Democracy, the second largest in the world, is functioning? Is it ad-hoc? Nah! There are basic processes and structures that drive Indian democracy – The constitution of India. What if Constitution wasn’t there? What if people weren’t driven by any guidelines? Yeah! Total Chaos.
‘Framework’ is what drives almost everything – a basic outline or structure, a set of guidelines which when followed produce coherent & beneficial results. Be it manufacturing, politics or services. Then how can Test Automation Framework be different!
Test Automation Framework
Before moving to Test Automation framework, first let’s understand the different components involved in test automation.
- AUT: The application under test
- Test Automation tool such as HPE UFT or Selenium
- Test Management Tool where the test cases & screenshots are stored. In its absence a common shared drive can also be used.
- Test environment: A stable environment on which application is deployed for test purpose
- Application Objects: Different elements within application like textbox, checkbox, radio button, dropdown, etc.
- Application modules: Specific functional flows that needs to be executed within different test cases. E.g. User login.
- Test Data: Input values (valid or invalid) for the application fields such as Login credentials
- Functions: A set of reusable statements (for a particular functional flow) that needs to be executed within different scripts. E.g. User login.
- Test script: A standalone test case coded in a particular programming language using the test automation tool
- Results: This includes the error logs, execution status, screenshots, formal reports, 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 Test Automation Framework is 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.
Lead by Example
Hope this makes the concept a bit clear? No? Confused yet? To make it more crystal clear, let’s see some of the permutations & combinations of how these different components can interact, i.e. different ways these components can be organized.
- User uses a record-and-playback feature wherein user records each step of the test case (including navigation & data inputs) >> script is auto-generated >> edit the script to insert checkpoints >> Playback the script. Environment, Objects & Test data are all captured during recording in the test script.
- Instead of recording each & every step, club common tasks like User login into functions which can then be called from within different test scripts.
- We can create a separate object repository to store details of all application objects and then use these objects in test scripts, instead of identifying the object every time in every script.
- How about we keep the Test data outside the script? Say in a separate excel file? And then load these values in script variables at run-time?
- Say we create different functions for every application flow/action and then read the sequence of steps (along with the data) from an external file like excel sheet? E.g. OpenHomePage >> EnterUsername >> EnterPassword >> ClickLogin
- What if we define a common Configuration File containing all the environment settings like application URL, browser specific information, login credentials, etc.?
- Capturing the screenshots for only the failed steps & creating a cumulative Pass/Fail report at the end of test execution which is saved in a shared drive
- Test results are logged into a separate log file which can then be mailed to stakeholders
The Test Automation framework provides the user with various benefits that helps them to develop, execute and report the automation test scripts efficiently – standard scripting, coherent approach, team consistency, scalability, modularity, less error-prone, understandability, re-usability, minimal manual intervention, easy reporting, reduced cost, easy maintenance etc.
To summarize, Test Automation Framework play a key role in automation testing. But before you start building a framework, keep in mind that there is a divergent range of Test Automation Framework available now-a-days – make sure you are building a framework which is best suitable for the project or application under test!
Well this was just an introduction about test automation framework and I hope you got the basic idea of what a framework is all about. In future posts we will look into the different types of test automation framework popular now-a-days, till then don’t forget to subscribe to get all the new updates in your inbox, for FREE!