13. Automation Testing

Before going in depth, we've to know the answers for the following seven questions:
  1. What is Manual Testing ?
  2. What is Automation Testing ?
  3. Why is the main purpose for automating the testing process?
  4. What are the other advantages of automation testing?
  5. Whether our application is suitable for automation testing?
  6. Which tests can be automated?
  7. Which automation tool should be used for automating the tests?
What is Manual Testing ?
Answer: It is the process of validating and verifying whether the software program works as expected without using any automation tool (Tester validates and verifies here)
  • Verification ( Are we doing the job right? ) is to check whether the software correctly implements the specified functionality
  • Validation (Are we doing the right job?) is to check whether the software is according to the client requirements
What is Automation Testing ?
Answer: It is the process of validating and verifying whether the software program works as expected using any automation tool (Automation tool verifies and validates here instead of tester)
  • Automation Tool is used to automate the manual process performed by a tester daily
  • Step1: Tester develops automation scripts using Automation tool (Example: QTP Automation Tool supports VBScripting - So tester develops VBScripting scripts using QTP Automation Tool) 
  • Step2: Tester runs the already developed automation scripts using the Automation Tool Run commands
  • Step3: Tester views the reports which are generated after running the automation scripts. These reports will have pass or fail values for the verifications and validations written in the automation scripts.
Why is the main purpose for automating the testing process ?
Answer:  Automation saves Testing Time by reducing repeated test sceanrios
  • Saves Time - Every time the source code of the Software gets changed by developers and provided to testers for test, the software tester should manually test all the test scenarios on every new software build (i.e. source core changed software). Manually repeating the same tests on every new build is time consuming. Automating this kind of repeated tests on one build and running the automated scripts on every new build, results in saving the time of a tester.
What are the other advantages of Automation testing ?
Answer: In addition to saving testing time, we are going to get other advantages from Automation Testing. They are:
  • Less burden for testers - The amount of time needed for testing repeated test scenarios on every new build is reduced to zero. As a result burden for tester reduces
  • Less cost for business clients - Business clients have to pay the tester for the number of hours they work. As the automation saves times, the client gets cost benefits.
  • Increases Test Coverage - As testing time gets reduced, the tester can cover testing other test scenarios within the provided time for testing.
  • Improves Testing Accuracy - In manual testing process, a tester may forget or wrongly test any test scenario. But while running automated test scripts, the computer wont forget or wrongly test the test scenarios.
Whether our application is suitable for automation testing?
Answer: We've to find out whether our application is suitable for automation testing. The main things we've to find out is: Whether our application is stable enough? If the answer is yes, then we can proceed automating our application.
  • Applications Stability - It means much of the functionalities will be stable over time without needing any changes. If your applications functionality keeps on changing, it means that your application is not stable and this kind of application wont be suitable for automation.
Which tests can be automated ?
Answer: We're not going to automate the complete functionality of the application. If application is stable enough to automate, then as a tester we have to make a decision on filtering the 'test scenarios that can automated' from all the test scenarios. How to filter the automation tests from the all the test scenarios? . We've to filter out the following types of tests for automation:
  • Stable Tests - The tests that remain stable or not going to change in the upcoming builds
  • Smoke Tests - The tests that give a quick high level assessment on the quality of build
  • Data Driven Tests - The tests which test the same functionality with different inputs and large data sets
Which automation tool should be used for automating the tests?
Answer: First of all we've to find out 'test automation needs' that are required for our application to automate. Later we've to find out/decided any automation tool which satisfies our 'test automation needs' to the best. Lets read all the possible 'test automation needs' that may be required while evaluating the best automation tool for our application:
  • Installation of Automation Tool - We've to find out which automation tool is easier to install.
  • License Type and Cost - We've two types of License i.e. Commercial and Opensource. We've to pay some amount to use the Commercial License tools and we can use the Opensource License for free. If any tool wants us to buy Commercial License, then we have to evaluate tool based on the cost of license.
  • Supported Applications - Test Applications are of two type i.e. Desktop applications (example:- vlc player software) and Web Applications (example:- www.google.com). We've to evaluate the automation tool based on the application type(s) it supports. 
  • Supported Operating Systems - If your application should be tested on any specified operating systems, then we've to evaluate whether the automation tool supports the operating systems (i.e. test automation tool should be able to run the created test scripts on the application's supported operating systems)
  • Supported Browsers - If your application should be tested on any specified browsers (Internet Explorer 9, Internet Explorer 8, Firefox, Chrome, Safari, etc.) , then we've to evaluate whether the automation tool supports the application's supported browsers (i.e. test automation tool should be able to run the created test scripts on the application's supported browsers)
  • Supported Technologies - Applications that are provided to us for testing purpose may be developed on some technologies (i.e. .Net, Java, Activex, Delphi, Flex, Siebel, PeopleSoft, Flash, Silverlight, Ruby, Ruby on Rails web OpenSource etc. ). So we've to evaluate whether our test automation tool supports the technology which is used in building our Test Application.
  • Ease of Use - Automation tool that is easy to use
  • Scripting or Programming Language - Different automation tools use different scripting languages to develop the automaton scripts. If we are familiar with any scripting language, then we can choose a tool which develops scripts in that language.
  • Documentation - Some automation tools will be available to us but without proper documentation on 'How to use the software?'. We've to choose an automation tool which provides proper documentation.
  • Simultaneously run on different browsers - If your application have to be tested on more than one browser, then you have to run the automation scripts using any automation tool on each and every supported browser separate. But there are few automation tools which run automation scripts simultaneously on different browsers.
  • Record and Playback - Tester can automate any test scenario of an application without writing/developing in scripting language. Few Automation tools by default come with options like Record and Playback. A tester simply clicks on Record button and the automation tool will generate test scripts (here tester wont write any script). Tester simply selects the tool generated test script and clicks on 'Playback' option, automation tool will run the generated script. [Lets discuss why to avoid Record and Playback later - But having this option is an added advantage]
  • Object Identification - Applications functionality is divided into different objects like 'Buttons', 'Combobox', 'Listbox', 'Frame' etc. For example Login Page has 'Username - Textbox', 'Password - Textbox' and 'Login - Button'. These objects should be identified by the automation tool  in order to automate the login test scenario. Automation tool identifies the Objects using 'Object Spy' functionality. Some automation tools have to use 3rd party tools in order to spy objects. Some automation tools that are not even having 3rd party tools for spying want the Tester to program the spying feature. [Object Spy feature, after spying objects, will provide functionalities to find out the properties of the spy-ed objects. Properties of objects are  Object ID, Object Name, Object Type etc. 
  • Object Repository - All the objects that are identified by 'Object Spy' functionality have to be stored in or mapped to a repository, we call it as 'Object Repository'. When every our scrips require objects, we map them from 'Object Repository', if they doesn't exist in Object Repository, then we add them to object repository first and map them to our test scripts. [Additionally user can view the properties of Objects in Object Repository.
'Security Testing' concept will be explained in the next post.