Importance of Software Test Automation using tools such as QTP

Software Testing plays an important role in Software Development lifecycle.
Doing manual testing is not enough. We should go for Automation Testing also.

  • “To Error is Human” is the fact which drives the need for automation testing. Because, manual testers may not execute the test cases correctly. There will be lot of possibilities for making mistakes. They may give wrong input data due to typo, or they may not notice the actual behavior of the system correctly, or they may not report the test result correctly, or they may miss to execute some test cases, or they may forget to run some preconditions, or they may change the sequence of test case execution in case sequence is important.
  • Another important factor is, Automation test scripts will be used as a way of storing domain/project/task Knowledge gained by the Test Engineers. Say for example, if a Tester works in project for one year, he might have spent more time for learning the domain, purpose of the project, modules in the project, flow of all functionalities. He will be familiar with known issues and challenges.
    If this Tester leaves from the project, the knowledge gained by him also will leave.
    It is very difficult for the newly joining Tester to understand everything from the Test Case document.If automation test scripts are already available then the new Tester can just start the testing by running the automation scripts, without gaining much knowledge about the project.He can understand the flow/data by seeing the execution of the automation test scripts. But anyway, he should gain project/domain knowledge to enhance/update the automation scripts further.
    So we can say that test automation is a way of storing knowledge.
  • Automation tool such as QTP (Quick Test Professional) has feature for storing screenshot of each and every page navigated during the execution. So it can be used as a proof for completion of testing, and also we can refer the screenshots of previous executions if there is any need to refer them.
  • Test report can be automatically written to a customized report page which will ensure accuracy of the report and also it can improve look & feel of the report.
  • The very important advantage of automation testing over manual testing is execution speed. Test execution can be completed quickly and also we can execution the scripts in night time also without human involvement. So ultimately total time needed for testing can be reduced which will significantly help for timely project completion.
  • Here may be requirement of doing some testing at specific time. It can be easily achieved by putting execution of those automation test scripts in a task scheduler/crone job. The tool such as QTP supports automation object model to achieve this.
  • The functional test automation scripts will be useful for doing performance testing also. Because many performance test tools will support reusing/calling of these test scripts.
  • Some type of testing involves comparing large amount of data between previous version and current version as part of regression testing. Practically it may not possible for doing it manually. This problem can be easily solved by simple shell script or any other scripts such as vbs, wsh.
  • As the automation test tools support Data Driven Testing, Test execution can be done repeatedly with many different data sets.

There are lot of automation test tools are available for doing Functional, Regression and Performance Testing. Test complete, SilkTest, SilkPerformer, QARun, QALoad, TestPartner, WinRunner, LoadRunner, QTP, Rational Robot and openSTA are some of them. QTP is most widely used now as it supports vbscript and it can be used for testing many different applications just by adding required add-ins.

You can Watch the below video explaining Importance of Software Test Automation.

How to Learn QTP?

This chapter will give overview about learning QTP. You can read the details in coming chapters.

  • Begin with understanding the importance of software testing. You should learn software testing Concepts and you have to get clear understanding of functional and regression testing. You need to be bit familiar with Manual testing activities such as writing test cases, executing test cases and reporting the issues.
  • You have to understand the need and importance of software test automation before start learning QTP. Even having some basic knowledge about other Test automation tools such as Test Complete, Test Partner, SilkTest and Rational Robot will help to prepare Tool evaluation/selection document if you are going to use QTP as Test Automation Tool in your project.
  • Download some good QTP handbook from internet. And also, you can refer the Tutorial and other Help files installed with QTP installation.
  • Try to understand basics of Object repository. You will become more familiar with using Object Repository once after start working on QTP automation.
  • Familiarize yourself using QTP add-ins (i-e selecting/deselecting specific add-ins). Desired Add-ins can be selected while launching the QTP. Note that the add-ins enabled during recording should be enabled while running the script.
  • Understand the basic units such as Test, Actions and external vbscript in QTP by going thro’ the Help file and the Handbook document. Practice yourself by creating simple Test with one or two Actions.
  • Practice yourself by recording and playing some steps using the sample application (Flight booking Application).
  • Try to understand the need for having multiple Actions in a particular Test.
  • Practice yourself creating Actions and splitting the Actions. And also, understand the need for having external reusable actions, and practice yourself using “Call to Copy of Action” and “Call to Existing Action”.
  • Familiarize yourself with components such as Expert view, keyword view, Active Screen and Datatable.
  • Learn basics of vbscript by going thro’ the vbscript documentation available in QTP help file, and be familiar with syntax of frequently used vbscript functions such as mid, instr and split.
  • Do some practice to have clear understanding of relation between Test Objects stored in object repository and the Vbscript statements showing in the expert view. You can do it by changing name of Test Object in OR and see the name automatically got changed in the expert view statement. And also, you can try to add/remove/edit some properties of Test Object in the Object Repository.
  • Understand the relationship between the Keyword view and the expert view. Both views are having their own advantages. So try to use both views. For example, Keyword view will be useful for doing parameterization easily and expert view can be useful or rearranging the steps.
  • Learn different types of Checkpoints and use them in sample script developed using the sample application. Intentionally put wrong expected result in the checkpoints to see how the Test result will look when showing checkpoint failures.
  • Learn to use multiple Object repositories (both Local and Shared), and also practice to get clear understanding of merging of Object Repositories.
  • Learn Recovery Scenario to handle unexpected behavior of application.  For learning Recovery Scenario you may need some application which shows a pop-up window rarely/randomly. Mostly you can use a website which is having both https and http links. Security alert will be shown while moving from https pages to http pages.  You can use Recovery Scenario to handle this security alert window.
  • Read the Help file to get clear understanding of Datatable and parameterization. And also learn about Action iteration and Test iteration without any ambiguity. Practice it by creating Data Driven testing for simple login screen.
  • Start using Reporter.ReportEvent in the code to enhance the reporting of the results.
  • Use ObjectSpy to get familiar with finding both TO  properties and RO properties of the Object in the Application.
  • Learn to change Test Settings and the editor settings. Here you should have clear understanding of which setting is applicable for the particular Test and which setting is applicable for particular instance of QTP installation.
  • Understand the need for Synchronization and try to use different ways (use of sync(), waitproperty, and exist) to achieve it.
  • Practice to use Step Generator, Function Generator and Active Screen to speed up the automation script creation process. Effective use of Active Screen will help you to continue your QTP script development even when your application is not available.
  • Learn about different types of recording modes and understand the need for them. Low level recording may help you to handle some steps if the standard recording is not able to recognize the object using the currently available add-ins.
  • Learn how to create/use COM objects such instance of Internet Explorer browser and an instance of excel object. It will be very useful
  • Learn to use Debug feature effectively. For example, use of “Run from step” will significantly reduce the Debug time.
  • Understand the need for Regular expression and learn some frequently used regular expressions (e.g .*)
  • Learn about QTP automation framework creation, and try to create a framework best suitable for your needs.
  • Learn Automation Object Model and understand the need for them. For example Automation Object Model can be used for automatically start running QTP script at specified time.
  • Learn about best practices (e.g always using reference path) and coding standards.
  • Go thro’ the QTP forums (e.g www.sqaforums.com) and read the discussions to get familiar with QTP issues and solutions/workarounds.
  • Learn to connect with database table for checking the database content. For doing this either you can use Database Checkpoints or you can create script using createobject.
  • Learn basics of Descriptive programming (DP) which is the alternative for Object Repository (OR). Personally I won’t recommend to use DP because it will create maintenance problem. But anyway we need to learn Descriptive programming in case we need to update any existing DP code.
  • Learn to integrate with Quality Center (QC) which is Test Management Tool provided by HP. It was formerly known as “Test Director”. We can execute the scripts from QC itself. And, it is used  for maintaining Test cases and tracking Bug/Issues. Appropriate integration of QTP and QC will make Script maintenance, Execution and Reporting easy.