Jan 20, 2013

Designing Test Automation Framework with Selenium

Do we need to go for Test Automation? If yes, then which is the tool?
If we straight away start automating test cases what are all the technical challenges we might face? Do we need a framework for Automation? How we go about designing a framework?
These are all the questions popup when we want to start Test Automation. Okay, let us start exploring answers for the above questions.

If there are hundreds of test scenarios which needs to be executed on each build then it will be a tedious task and error prone.  Because a Test Engineer might make mistakes while entering the test data and output might be wrong. We can avoid such situations by automating the test cases.
Before selecting a tool for Test Automation, we need to analyze the technologies used for different UI components. For example, Java Swing components, Telerik controls, ExtJS tables, Ajax, Silverlight, Flex / Flash controls, etc. If we want to use Selenium as Test Automation tool then the first and foremost thing needs to be checked is whether the application is a Web Application. If so, then check whether most of the UI controls are identified by the Selenium. If more than 70% of the test cases can be automated then definitely we can go ahead and automate the test cases.
In order to handle large number of test cases we need to have a clear cut strategy for designing the framework. Some of the framework functionalities can be mentioned as follows:
  1. If there is any unhandled exception, then the execution should not stop.  Particular test scenario should be stopped and continue with the next scenario.
  2. Screen shots must be taken for each error so that analyzing the failures should be easy.
  3. Proper exception handling should be done in the framework.
  4. Proper naming convention should be used
  5. Avoid hard coding test data
  6. Test Data should be parameterized using external means such as XMLs, Database, Spreadsheet, etc.
  7. Logs should be created that makes life easier while analyzing the Test Execution
  8. Proper folder structure should be created.
 If we need to create a Test Automation Framework with all the above mentioned features (or anything beyond this) for Selenium, then we need to use the programming language as JAVA and Eclipse as the IDE (Integrated Development Environment).
Test Automation Engineers should have knowledge of Java then it makes their life easier for automating the test cases

No comments:

Post a Comment