How to load the object repository at run time?
Answers were Sorted based on User's Feedback
Answer / vinod
To be more simple
go with this
RepositoriesCollection.Add " .tsr File path "
| Is This Answer Correct ? | 16 Yes | 1 No |
Answer / sanurajps
hi,
One of the new feature of QTP 9.2 is Dynamic Management of OR.
>>ADD - RepositoriesCollection.Add("D/OR/test.tsr")
-- it will add the 'test.tsr' file during the run time
>>FIND - Pos = RepositoriesCollection.Find("D/OR/test.tsr")
-- it will return a numeric value to the variable 'Pos' this
is nothing but the index value of the specified file
>>MOVETOPOS - RepositoriesCollection.MoveToPos(2,5)
-- here 2 is the current index and 5 is the new index
position. In this case it will move 2nd item to 5th position
>>REMOVE - RepositoriesCollection.Remove(5)
--it removes the 5th object repository file from the OR
>>REMOVEALL - RepositoriesCollection.RemoveAll
--it removes the full items from OR. Makes object repository
empty
>>COUNT - no = RepositoriesCollection.Count
--stores the number of repository items to 'no'
>>ITEM - desc = RepositoriesCollection.Item(4)
--returns the path of the 4th object repository file.
Thnx
Sanu
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / sandeep.v
Dim qtApp
Dim qtRepositories
Set qtApp = CreateObject("QuickTest.Application")
Set qtRepositories = qtApp.Test.Actions
("ActionName").ObjectRepositories
qtRepositories.Add "E:\Sandeep_Documents\Sandeep_Working\sha
redRepository.tsr"
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sarath
Tried with QTP 9.1 and it works....
Dim qtApp
Set qtApp = CreateObject("QuickTest.Application")
'Add
qtApp.Test.Actions(1).ObjectRepositories.Add "C:\ObjRep.tsr"
'Remove
qtApp.Test.Actions(1).ObjectRepositories.Removeall
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sari
hi krishna,
LOADING OBJECT REPOSITY AT RUN TIME U WROTE SMALL FUNCTION
IN THAT U MENTIONED OBJECT .
CAN YOU PLZ EXPLAIN HOW THAT OBJECT WORK COMPLETELY
REGARDS
SARI
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / atin
QuickTest Professional 9.0 does not support dynamically
loading object repositories at runtime. AOM (Automation
Object Model) statements are not designed to be executed
from within a test script.
QuickTest Professional 9.0 does allow you to associate and
load (not at runtime) multiple Object Repository files.
-Atin Srivastava
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / uday kumar_anem
Use the Automation Object Model to specify the path to a
Object Repository:
Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Test.Settings.Resources.ObjectRepositoryPath
= "<PathToYourObjectRepositoryFileHere>"
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / krishna reddy
Hi We can call the TSR file in runtime and in 8.2 and 9.0
also.
How means.. i am giving one function
Public Function UDF_ORUpdate(g_ActName,sv_qtFileName)
Dim qtApp
Dim qtRepositories
Set qtApp = CreateObject("QuickTest.Application")
Set qtRepositories = qtApp.Test.Actions
(g_ActName).ObjectRepositories
qtRepositories.removeall
qtRepositories.Add sv_qtFileName
End Function
| Is This Answer Correct ? | 1 Yes | 4 No |
How can we get a textcheckpoint in QTP9.1?
How many lines of code in each script of QTP?
what are the frame work models of qtp?which frame work you follow in your company?and explain it process?
write a vb script to print even numbers from 1-50?
6 Answers Kclink Technologies, Logica CMG,
If you are using descriptive programming and you have two objects with the same name, so you are identiying them by name and index, how can you avoid errors if a third object with the same name is added at the begining of the page?
WHY U CHOOSE TESTING FIELD?
What will be happen if i load object repository at run time, but it has already associated.
GET WHETHER THE GIVE NUMBER VALID OR NOT IN BETWEEN THE GIVEN RANGE?IN VB SCRIPT(QTP)
I am having major problems with some DB Table Checkpoints I add to my script. I 35 web based applications recorded and each has DB Table Checkpoints insert but only 1 script isn't recognizing the DB Table Checkpoints for some reason. I've checked the DB connections and the info in the Library Functions and still only this one script out of 35 doesn't recognize the DB Table Checkpoints. Can someone please help me figure out why only this one script out of 35 that's hitting the same database is having a problem.
How to interact tool & application build in QTP?
what is the difference between development and testing
What are the different types of recovery operation?