Monday 25 March 2013

RepositoriesCollection Object in QTP



 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 -
  1. QTP Questions and Answers for Experienced guys
  2. Advanced QTP Questions and answers
  3. Advanced QTP Tutorial
  4. 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

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.