How to load the object repository at run time?

Answers were Sorted based on User's Feedback



How to load the object repository at run time?..

Answer / vinod

To be more simple
go with this

RepositoriesCollection.Add " .tsr File path "

Is This Answer Correct ?    16 Yes 1 No

How to load the object repository at run time?..

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

How to load the object repository at run time?..

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

How to load the object repository at run time?..

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

How to load the object repository at run time?..

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

How to load the object repository at run time?..

Answer / ram.polavarapu

Repositarycollection.Add"file.tsr"

Is This Answer Correct ?    1 Yes 1 No

How to load the object repository at run time?..

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

How to load the object repository at run time?..

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

How to load the object repository at run time?..

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

Post New Answer

More QTP Interview Questions

How will u integrate oracel with QTP?

2 Answers   Microsoft,


What is difference between Recording time object identification and Run time (Execution) time.

0 Answers   Tech Mahindra,


I have 5 save buttons in 5 tabs . The tabs are placed one after the other. My object repository have these added as 5 save buttons with name sav1, save 2, save 3 , save 4, save 5 .all are getting highlighted from OR but they are not getting clicked. After spying each button all the properties are same except First button Index 0 html id:=btnSaveTab1 outerhtml:=<input id=""btnSaveTab1"" class=""Button"" onclick=""document.getElementById('a1').click();"" name=""btnSaveTab1"" value=""Save"" type=""button"">", Second button "html id:=btnSave "outerhtml:=<input id=""btnSave"" class=""Button"" onclick=""document.getElementById('a2').click();"" value=""Save"" type=""button"">", Third button "html id:=", outerhtml:=<input id=""btnSaveTab1"" class=""Button"" onclick=""document.getElementById('a1').click();"" name=""btnSaveTab Fourth button "html id:=btnSave outerhtml:=<input id=""btnSave"" class=""Button"" onclick=""document.getElementById('a2').click();"" value=""Save"" type=""button"" 5th button "html id:=", "outerhtml:=<input class=""Button"" onclick=""document.getElementById('a5').click();"" value=""Save"" type=""button"">",

0 Answers  


I recorded a Web based Application running on JAVA and when I went to play them back a week later they didn't run. I noticed that the Browser was putting in a (Underscore and a Number) for each line so i re-recorded and noticed the Underscore line wasn't the same as what i recorded last week so any script I record today will not work next week because the browser settings or how QTP recognizes it keeps changing. This is the new line Browser("Bureau of Labor Statistics_4").Page("Bureau of Labor Statistics").JavaApplet("SurveyApplet").JavaList ("Select an Area").Select "U.S. city average" This is the old line 'Browser("Bureau of Labor Statistics_3").Page("Bureau of Labor Statistics").JavaApplet("SurveyApplet").JavaList ("Select an Area").Select "U.S. city average" Notice the Burearu of Labor Statistics_3 adn Burearu of Labor Statistics_4. Why does it change and how do I prevent it from changing.

5 Answers  


When we use Object Spy? can we write QTP script before built is came in testing?

3 Answers   Impulse,






Plz suggest me a good training institute in Mumbai/hyderabad for QTP…. Plz advice thank u

29 Answers   IBM,


what difference between client and server applications exatly?

1 Answers   Honeywell,


what is defenetion of kiran can u tell me plz CVS, SVN

0 Answers  


does test plan is in test strategy or test strategy is in test plan.

6 Answers   Microsoft, TCS,


How many types of parameters are available in quicktest professional?

0 Answers  


How we can call the scripit from another scripit in QTP?,Not a call Action

12 Answers  


Hi, I have weblist which contains the data like Design change,admin edit and cost saving etc.. User doesn't know the values existed in weblist. Now the user has to select the right value from the list otherwise the test will fail. Pls help me "To select the correct value from the list"

1 Answers  


Categories