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