15 Best Practices and Strategies for Test Automation
You might be wondering:
How professional Automation experts manages Test automation?
What all are the Practices & Strategies that they follow for a great Test Automation framework to survive in long term without any huddles?
In this blog,
I am going to reveal, some mandatory strategies to keep in mind while performing Test Automation on your project.
These are the exact points/checklist that I have consolidated from Software Testing Veterans or gurus Michael Bolton, James Bach and Cem Kaner and my own past experience of 5+ years.
Are you excited?
Say Yes…
Let's Start...
May be, You are going to start Test Automation project in your company but you are not confirmed what all are the best practices for Test Automation?
1
Contents
Choose the Right Test Automation Tool for Start.
Suppose,
If you want to do Automation for a Microsoft PC Desktop app, choosing Selenium as automation tool is clearly not a good decision.You should go with the AutoIT Tool.
Make sure you are clear with the advantages or disadvantages of that tool that you are going to use in Test Automation.
Do some POC and figure out early if it is handling your requirements or not.
“If there was one weapon he had against these savages, it was not acknowledging their existence.”
― Melina Marchetta, Finnikin of the Rock
Knowledge about the Other Test Automation tools and their pros and cons is must and You should avoid these naive mistakes while choosing Right tool for Automation.
Sometimes by losing a battle you find a new way to win the war. - Donald Trump
2
Use Design patterns in Test Automation for the God sake
There is famous quote
In the Test automation,
It is mandatory to code using well practices and pattern so that people can understand your code with minimum efforts.
“I'm not a great programmer; I'm just a good programmer with great habits.”
― Kent Beck
So you need to develop the good habits, and what are all Good habits in Test automation?
Design Patterns
Learn to use Page Object Pattern if you have working with the Selenium.
Never ever code in Spaghetti pattern where every test cases is tightly coupled with the Other Test case.
People have hard time understanding these kind of patterns and it will lead a bad impression on your colleges or senior resources.
My favorite quote about coding it that -
“Truth can only be found in one place: the code.”
― Robert C. Martin

3
You Can’t ignore the Naming convention
There are few rules that we need to follow for a clean code while creating a Test automation
Use below Rules to choose the Name of the variable.
4
Extensive use of the parameters and Data driven Testing.
Data driven is probably the best Testing framework to introduce in the Test automation. It basically means that the input variables, data or parameters are fetched from separate files like CSV,JSON,XML,ADO objects, ODBC sources rather than hard coding into the same test cases.
5
Do frequent refactoring whenever required for your test cases.
Refactoring means that changing the code to make it easier to understand without adding the extra functionality in the Test cases.
For your Test automation to succeed it is mandatory to refactor your code time to time
6
Implement Logs, screenshot , Reports like Professional.
If you are developing a Test automation,Screenshot and logs are used for debugging purpose and Test Automation reports are best to share the automation progress with the seniors or product owners.
