RepositoriesCollection Object is used to associate or disassociate shared object repositories to QTP at run time
At the beginning of a run session, the RepositoriesCollection object contains the same set of object repository files as the Associated Repository Files tab of the Action Properties dialog box. The operations you perform on the RepositoriesCollection object affect only the run-time copy of the collection.
You use the RepositoriesCollection object to associate or disassociate shared object repositories with an action during a run session.
RepositoriesCollection Methods
Add - Add .tsr file to current action in test
Find - Find the index position of .tsr file in collection
MoveToPos - Change the position of repository
Remove - Remove repository from current action in test
RemoveAll - Remove all repositories from current action in test
RepositoriesCollection Properties
Count - Get the total number of .tsr files associated to current action in test
Item - gets the path of the tsr file located in the specified index position.
We can add any number of .tsr files to current action in test at run time.
Example -
RepPath = "c:\Mercury\my.tsr"
RepositoriesCollection.RemoveAll()
RepositoriesCollection.Add(RepPath)
Pos = RepositoriesCollection.Find(RepPath)
RepositoriesCollection.Remove(Pos)
RepositoriesCollection.Add(RepPath) ' add tsr filr
Window("Microso").WinObject("my").Click
Pos = RepositoriesCollection.Find(RepPath)
You may also like -
- QTP Questions and Answers for Experienced guys
- Advanced QTP Questions and answers
- Advanced QTP Tutorial
- QTP (UFT) Master Page
Dear friend - What do you think about this topic? Please express your thoughts via comment box.
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs