Skip to main content

HP QTP Tutorial - Chapter 9

1 Resources

In my previous chapter, I discussed about the features available in Automation Menu including Run and Record Settings. This chapter covers the features available under Resource Menu option. This chapter explains the following features available under Resource Menu:
clip_image002

Some of the features under Resources are very frequently used when you need to do the scripting and manage your Shared or Local Object Repository. You can manage your Object Repository; Associate your OR, Add Recovery Scenario etc. We will cover most of these features in detail in this chapter.

1.1 Object Repository

When you are doing your scripting and want to view the Object Repository which is attached with the current Test Script, you can access it using Ctrl+R or by navigating to Resources->Object Repository.: You will see a below screen which is having multiple commands for modifying and adding new test object in your local or shared object repository. This is one of the screens which is very frequently used during scripting and you must be aware about the usage of this functionality.
clip_image004
As you can see that on the left hand side you have the detail of the entire test object in a tree like structure and on the right the object properties details where you can add or modify the detail of existing or new objects. We will cover Object Repository and Object Repository Manager in a separate Chapter as there are various useful features which cannot be explained in this Chapter.

1.2 Object Repository Manager

Object Repository Manager is the place where you can Open an existing OR and you can add or modify the OR properties. This again is a very frequently used feature of QTP.
clip_image006

There are features which are common to OR Manager and Object Repository screen. To access Object Repository Manager, navigate to Resources->Object Repository Manager.
As a best practice while modifying the Object Repository, please ensure that you are opening the OR for modification when no one is modifying it at the same time. One of the mistake which people do is they will not open the latest version of OR and they might have opened an old version and modify it and then save it. If you will do like this, the changes done by other will be lost. So never modify your OR which was open earlier and then you press the edit button. Always make a practice to Open and then edit and not opened and edit.


1.3 Associate Repositories

This feature is also very frequently used and when you need to associate a shared OR with your current Test, you need to do it by Associate Repositories. You can access this feature by navigating to Resources->Associate Repositories.
clip_image008 clip_image010
clip_image012
To associate an OR you can click on + icon and navigate to OR location and then click OK. The selected OR will be visible in the Repositories Section. You can repeat the same process to associate multiple ORs. Once you selected the OR, then click on > button so that available actions will move to Associated Actions. Once you performed these actions, then click on OK. This will complete the process of associating OR to your Test.

1.4 Map Repository Parameters

Map Repository Parameters feature can be used when you want to parameterize the property values of an object. You can access this feature from Resources->Map Repository Parameters. Let’s take an example to better understand the concept of Repository parameters. Suppose I have an object say Edit Box and the property of this edit box changes dynamically following some pattern such as txt001, txt002 etc. In such a case you can parameterize this property value. In real time, test scripter hardly used this feature of QTP as they manage such changes using Regular expression.
Before mapping the parameter, you must define the parameter for the Object Repository. You can do this from Object Repository Manager. Open OR Manager and then navigate to Tools->Manage Repository Parameters. See below screen shot
clip_image014

Click on + icon to define new parameter. The screen is self explanatory. Once this is done then you can view all the Repository parameter from Manage Repository Parameters feature of Resources Tab. See below screen:
clip_image016
Note: This feature of QTP is not used in real time but you should know why this feature exists in QTP.


1.5 Recovery Scenario Manager

Recovery Scenario Manager is the feature which decides the action which will be taken by QTP when it encountered any expected or unexpected error. You must define a Recovery Scenario for your Automation Framework and will ensure that each of the Tests is calling the Recovery Scenario to handle error conditions. This is error handling mechanism for QTP Script.
You can access Recovery Scenario Manager from Resources->Recovery Scenario Manager. Refer below screen shot for Recovery Scenario Manager. I will dedicate a separate chapter on this functionality.
clip_image018
As a best practice, define Recovery Scenario for Global Error Condition which is Exceptional in nature such as QTP Tool Error, System Error etc. Do not replace Script error handling with the use of Recovery Scenario. I will not recommend the use of Recovery Scenario for Object State, Pop-up Window or Test Run error. But you can use it for Application Crash Conditions which is exceptional in nature.

1.6 Associated Function Libraries

Sometime when you are doing scripting in a big team and there are functional libraries, OR which need to be included in the test script and you want to check whether Function is associated with Test or not, you can use Associate Functional Libraries feature to see what function library is associated with your Test.
clip_image020

2 References

Quick Test Professional Tool.

3 Additional information

You can email me on Sachin.vasudha@gmail.com with any query.

4 What Next?

In my next Chapter I will explain the features of Object Repository Manager.

Comments

Popular posts from this blog

Mantis - Defect Management Tool - User Guide

Introduction This white paper contains information related to an open source defect management tool called Mantis which is freely available for managing all your defects. Where to Download One can download the latest version of Mantis from http://sourceforge.net/project/showfiles.php?group_id=14963 Download the “mantis-stable” and then “mantis-x.y.z.zip”.1.1 PRE-REQUISITE Operating System Windows 2003 Server, MacOS, OS/2, Linux, Solaris Database MySQL database 3.23.2 and higher Software PHP 4.0.6 and higher Application Server Apache 1.3, Apache 2.0.54, IIS 6.0 with Web Services Extension Browser IE6 and above, Mozilla Firefox STEPS FOR INSTALLATION – FOR WINDOWS MySQL Installation Install MySQL by downloading it from http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0-r6-win32.msi/from/http:/www.mirrorservice.org/sites/ftp.mysql.com/ . Please follow the below mentioned steps while installing MySQL: (Please remember the password for “root” account...

Why to do Software Testing?

Regardless of the limitations, testing is an integral part in software development. It is broadly deployed in every phase in the software development cycle. Typically, more than 50% percent of the development time is spent in testing. Testing is usually performed for the following purposes: To improve quality. As computers and software are used in critical applications, the outcome of a bug can be severe. Bugs can cause huge losses. Bugs in critical systems have caused airplane crashes, allowed space shuttle missions to go awry, halted trading on the stock market, and worse. Bugs can kill. Bugs can cause disasters. The so-called year 2000 (Y2K) bug has given birth to a cottage industry of consultants and programming tools dedicated to making sure the modern world doesn't come to a screeching halt on the first day of the next century. [Bugs] In a computerized embedded world, the quality and reliability of software is a matter of life and death. Quality means the conformance to the ...

Is BCI (Brain Computer Interface) a road to immortality?

What is a Brain-Computer Interface? Brain-computer interface is a technology which can read your mind and display it on a device - a mobile, laptop or TV screen. It means what data is being carried by our billion neurons are prone to hack.  When combined with other mechanical devices, can also be used to control the device.  So in future, if you want to switch on your TV or light, you just have to think and that's all.  Google and Alexa home will be replaced by BMI controlled devices.  I am not an expert in this field but based on my research and analysis, I can predict that when BMI tech will get matured, the human can do brain to brain talk and many other magical things - in future Telepathy will be a day to day affair. BCI can give you all kind of experience from the comfort of your home.  You can go on vacation without leaving your bedroom. You can have romantic experience without having a partner and many more such experiences. ...