Object Repository - the saga continues.
I have copied some code from one action and pasted into another new action, basically to open open a browser by clicking on a webelement. By copying the code I foolishly expected QTP to be able to execute the code the same way as the action I copied it from. [img]images/icons/smile.gif[/img]
However, an error appeared saying that the webelement was not in the object repository.
Does each action have its own repository? If so how can I turn it into a global one? Or will I have to put all my code in one action. Why would anyone use an object repository per action? Please advise before I've pulled out whats left of my hair!
Re: Object Repository - the saga continues.
JJN -- Object Repositories can be one of two kinds, either Per Action or Globally Shared. By default, they are Per Action. In order to change that, you have to go to Test>>Settings, select the Resources tab, and in the lower right hand corner, choose the Shared button. Then, either accept the default location, which is in the local install directory, or (if you plan on sharing across multiple team members) somewhere on a network share; optionally, if you are using TestDirector also, you can store it there. Some considerations: You must make this choice before doing anything in the script; once you have written a single line of code, the type of OR cannot be changed. If you have selected Shared, you can always change the actual file, but not the type. OR files are locked for write access at the file level, which means only one person can be adding new objects at any time; so, in the early going where the entire team is busy building new scripts, I recommend multiple shared OR files, essentially one per team member, and a OR manager who blends them all together; this is also a good time to enforce configuration and naming conventions. This setting is for each individual script; if you want to make it the default for all scripts for a given desktop, once you make the selection, press the "Set as Default" button.
Per Action OR's are fast and easy, and small, which may improve performance somewhat. But I have never seen them work well as a long term solution in a team environment.
That being said, shared repositories have their challenges as well. One of the difficulties of what I have described is that there is no MI provided clean path to moving stuff around inside of an OR or between to OR files, especially if one is Per Action and the other is Shared. So my company created such a utility, and we give it away freely. It can be found at www.sirius-sqa.com. It is currently QTP6.0 only, but 6.5 will be out by the end of this month.