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

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 ...

HP Quality Center - Best Practices

1.Introduction Quality Center is a test management tool which provides very good features for managing both your manual and automated test cases. This paper highlights the best practices for managing your test cases. When you open Quality center, depending on your rights it display the below mentioned option in the sidebar: 1. Requirements 2. Test Plan 3. Test Lab 4. Defects 5. Dashboard 2.Requirements When you have assigned with the responsibility of developing your test cases in the quality center then you must be wondering where to start with. I am going to share my experience to overcome such a situation. You need to find the solution of some question before you start writing your test cases. 1. Is your requirement developed and available? 2. Is your requirement organized in a logical sequence? If answer to both of the above question is Yes, then you can start with Requirement option in the side bar. In case your requirement is under development, then you keep your...

ABC of Unit Testing

What is Unit Testing? After writing any code, every programmer will do some kind of testing to make sure the code works as expected. This testing is called 'unit testing'. Unit testing is done in different ways. Some programmers write simple test applications to test their own code. Some others simply debug the code and change the values during debugging to make sure the code works fine for different cases. Some facts about unit testing: Unit testing is done by developers. Quality department does different tests, they are not unit tests. Every programmer must do unit testing after finishing development or during development itself. Unit testing can be done by writing separate test applications to call your classes and methods to make sure the classes work as expected. This is called manual unit testing. Unit testing can be automated by writing unit test scripts. This is called Automated Unit Testing. In automated Unit Testing, after writing each class/method, you will write sev...