Object repository is an in-built feature of UFT. It is like a container which contains all the test objects of AUT(Application under test). You can click on the icon on tool bar to open object repository.(Icon shown below)
Types of Object Repository:
There are 2 types of object repository.
1. Local\Per Action object repository : Local object repository is by default attached with a new Action.Whatever we record on an application, all recorded objects will be stored in local object repository. It is stored with the extension .bdb.
2. Shared object repository : To create a shared object repository, choose the option from local object repository File-> export local objects and save it at the desired location. It will be saved with the extension .tsr.
Features of Object Repository:
1. Recorded or added objects with a parent and child hierarchy.
2. Button to add new objects.
3. Update the properties of existing objects from AUT. Select the object in OR and click on this button. Then hover on that object in AUT and select. It will pick up the updated properties.
4. It will add insight objects which are image based identification.
5. Define new object – We can create an object manually by providing Environment,properties and class name.
6. Highlight the selected object in AUT.
7. It helps to locate the object in object repository and will be useful when object repository is huge. Click on it -> select the required object from AUT and click OK . it will identify the object in object repository or give error message if object does not exist in OR.
8. Object Spy- used to spy over the objects in AUT and find out their properties. It can be useful while writing descriptive programming.
9. It will associate the shared repository to the particular action.
10. Logical name of the object- it can be user defined. When changes , same will be reflected in the script as well.
11. It tells which class objects belongs.
12. It tells if object repository is local or shared.
13. It is used to add more properties into test object properties pane if existing properties are not enough for object identification.
14. Remove the selected properties from test object details.
15. It will restore the mandatory properties set required for object identification.
16. Properties of the object which will help to identify the object at run time in AUT.
Is it possible to create more than 1 shared object repository?
Yes, It allows to create more than 1 shared repository.
Note: By default, shared OR(Object repository) will be opened in read only mode. For editing the shared OR, We have to go the options ‘Resources –> Object Repository Manager’ and there we can open the shared OR from its location where it was saved. It will still show in read only mode. For making it in editable mode, we have to click on one icon called ‘Enable Editing’. Icon is available on the tool bar in Object repository manager.
Can we attach more than 1 shared object repository with 1 Action?
Go to ‘Resources -> Associate repository’ –> Click on + sign and attach the desired repositories with the selected Action. Move the Action from ‘Available Actions’ window to ‘Associated Actions’.
Can we merge 2 object repositories?
Yes, We can do that. Go to ‘Resources –> Object Repository Manager’. In object repository manager, Go to Tools –> Object Repository Merger tool’. We will get 2 browse options to open 2 shared repositories for merging. When we click ‘OK’, it shows a window containing the details about ‘conflicting object’ and ‘Merge summary’. It shows 3 types of conflicts as shown in the screen shot and we can take action or modify object as per our need, if required.Close the window. When we click on save button, it will be saved as a third repository with all the merged objects. Look at below screen shot for more clarity.
Can we compare 2 object repositories?
Yes, We can do that. Go to ‘Resources –> Object Repository Manager’. In object repository manager, Go to Tools –> Object Repository comparison tool’. Same way as above, select the first file(OR1) and second file(OR2) and click OK. It will open a window with the details of the unique objects(Highlight in blue colour) and conflicting objects(Highlight in Red colour). We can see first OR in left pane and second OR in right pane.
Object Repository Parameter: Object repository parameter are used to parametrized the object whose properties are changing dynamically in the Application. Suppose, there is button ‘Submit’ in the localized application and button’s text property gets changed as the language of the application changes.Now, in this case we can parametrized the text property of the button so user can provide the property value according to the language. For better understanding, We have created a video. Click here to access the video.