Areas to focus when developing a test automation framework
Kushan Shalindra Amarasiri
Director Quality Engineering at Social Catfish
Test automation framework is a platform which consists of a test automation tool or a test automation API that integrates best practices and standards. For test automation to survive in the organization for a long period of time its essential to have a good test automation framework. In this article lets look at some areas that we should focus when creating & maintaining a test automation framework.
- Reusability is a must - A test automation framework should promote reusability. It should use reusable methods and page classes. Page object model or Page factory methods should be used. Web services automation framework, the request methods should be reusable which enables easier maintenance. When UI elements changes its easy to do changes and promotes one place to change.
- No hard coding of test data - Test data should be driven from a file like Excel/JSON or Java Properties file. Easy to run the framework test in different test environments.
- Reporting is a must - A test framework should have reporting. We should what test are passing and what are failing, and why are they fail. We can add screen shots. Test reporting can be simple dependency add and get it working as most framework reporting works with the current test execution framework assert mechanisms.
- Portability - Please ensure all the utility files and data files are within the framework folder structure and they are not everywhere in your system.
- Backup is necessary - Its better to backup your framework and automation test repository in a source control mechanism like GitHub even when there are multiple users are working on the same test automation repo, its good to have version control.
- Wrapping commands - Its a good practice to use wrapper methods in your test framework which will reduce the width and depth of the commands. For example a standard Select method for dropdown uses two commands, we can create a wrapper methods which uses a single command universally across the framework.
- Coding & Test automation standards - We should use the organization's developer coding standards and automation standards and if automation standards not available team should create before practicing automation.
- BDD is not essential - As professionals in the industry says BDD in a test automation framework is not essential. It can be an optional layer. Use if only the organization practices it or customer insists to use it in the framework.
- Add universal utility methods like explict waits rather than using standard methods and try to create wrapper methods which will actually makes the life of the test automation easier.
- Have a review process in place - Conduct peer reviews or lead reviews on the automation code developed by the team, ensuring they are on proper standards.
- Integration to Continuous Integration - To get the best out of the test automation regression framework its good to have it integrated to the CI solution.
- Have everything documented - The framework used should be documented well, including its commands, deployment process, features, etc.
- Use headless where possible - Use the option of headless browser where possible, as it promotes speedy execution and less resource usage.
- Promote extendibility - Adding new functionality should be possible which promote space to expand the boundaries of your test framework. Simple add of a dependency and utility method should make this possible.
These are some of the great areas we should look into when creating and maintaining a test automation framework in your organization.
All the point's are well covered, appreciated the knowledge sharing.