Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Tips to be followed for a successful test Automation

We associate a lot of Return on Investment with software automation. There is high expectation from test automation that it will reduce the long regression cycles. But more often than not, we see a lot of maintenance cost associated with the test automation.


In this article, we will discuss why does automation fails and what needs to be done to ensure test automation pass. I have collected the information from feedback received from multiple test automation developers and personal experience.


  • Wait and Study application First –In daily life, we learn is to understand the problem and then react. Similarly, we should never rush into software automation. First step before starting automation is to say hello to the application or system of applications which needs to be automated. Ask questions on the technologies in which the application is developed. E.g.: Is it a web application. Are different technologies used in the application, or there any web services used in the application and so on.
  • Understand the expectation from the client on the scope for the automation.
  • Choose the best tool for automation – Based on the technology used in the application, objects in the application, Choose the best tool for automation. E.g.: Tool A is an open source tool supporting Web application only. Tool B supports both Web Application and web Services both and Tool C supports only Web Services. We have to understand the limitations and benefits of different tools and choose the best suited tool for automation.
  • Do a small Proof of concept on the application to understand whether automation is feasible and we are able to cover the complex scenario in the application with focus mainly on interaction with application, e.g.: Object Identification, Interaction with external cards and systems. Another focus area should be which framework approach will be best suited for the automation, whether to go for Keyword, hybrid, data driven or BDD framework.
  •  Get an initial closure on the scope of the automation with the client in the project and the possible estimate to complete the automation, and the expected maintenance cost for the automation.

Right, we have reached a stage, where we as well client feel automation is possible. Now comes the real part, creating the framework for the Project.


Framework is like the initial building blocks. If it is strong, the building will be strong and will sustain for a longer period of time. Below are the key features of a robust framework structure:


  •  Key Component of an automation framework should be :

    • Error handling

    • Test Reporting – Test Reporting should be clean and easy for a tester to interpret which all tests fail or Pass.

    • Different classes/libraries for different types of methods or functions. E.g. suppose we are creating a project in Selenium. We can create different classes for reporting, common functions, database interaction, and different classes for selenium scripts where WebDriver interacts with application.

    • Creating different libraries helps in better maintenance of automation as we need to change the specific library code. Also suppose we move from Selenium to any other tool in future, the framework will be intact and change required in few classes only.

    • Test data Management for test data, global constant and environment variables

    • Maintaining constants and description properties in property file or separate location. In case property of object changes, we will make changes in the file without going in the scripts.

  • One of the reason for automation failing is the automation suite grows too bulky; Try to divide the test suite into logical units with flexibility to end users to easily select the subset of test suites to be executed.
  • With increasing popularity of agile, the code should be continuously integrated and run with CI.
  • Maintain Version control of automation code to ensure we maintain history of automation code and test artifacts.
  • Reviews and dry run for both positive and negative scenario should be done in the dev phase.
  • Never try to automate the application 100%. Automating one time tests scenario cause load of the automation code growing it larger and making it difficult to maintain.
  • Comments as much as possible in the code. Understanding code of another person or own code, if revisited after long time is very difficult, it becomes more difficult if there are no or very less comments in the code

The list can be huge, but again as we discuss, as we should not try to cover 100% of scenarios in automation. On similar line, creating a post with very large information will fail the purpose of the post. Hope you like the post. Many thanks




No comments:

Post a Comment