Mercury.ObjectRepositoryUtil, for loading the OR dynamically in QTP 9.1 vr

557 views
Skip to first unread message

KANDUKURI NARESH

unread,
May 7, 2009, 7:21:25 AM5/7/09
to Mercu...@googlegroups.com

Hi all.

i am trying to use Mercury.ObjectRepositoryUtil, for loading the OR dynamically while running the script...


but it is not getting load...

QTP Vr is 9.1


--
Thanks and Regards,
Naresh Kandukuri...
Catch me @ 9989299857

Sreedhar Mallipeddi

unread,
May 7, 2009, 7:23:09 AM5/7/09
to Mercu...@googlegroups.com
hi

Use ObjectRepoistores.Add method to call the repertories...
--
Mallipeddi Sreedhar
91-9848871279

KANDUKURI NARESH

unread,
May 7, 2009, 7:31:45 AM5/7/09
to Mercu...@googlegroups.com
it is giving "object does not support this method"
 
i am using QTP9.1, in QTP 9.2, below code will work...
 
 
i am using the following code..
 
Dim RepositoriesCollection, RepPath, fso
Set fso = CreateObject("Scripting.FileSystemObject")
Script = Environment.Value("TestDir")
RelativePath = Trim (fso.GetParentFolderName(fso.GetParentFolderName(Script)))
msgbox RelativePath
strScriptName = Environment.Value("TestName")
RepPath = RelativePath & "\Object_Repository\abc.tsr"
Set RepositoriesCollection = CreateObject ("Mercury.ObjectRepositoryUtil")
RepositoriesCollection.LoadRepPath


Sreedhar Mallipeddi

unread,
May 7, 2009, 7:41:48 AM5/7/09
to Mercu...@googlegroups.com
use this 
Dim App 'As Application 
Set App = CreateObject("QuickTest.Application")
App.Test.Settings.Resources.ObjectRepositoryPath 
= "<PathToYourObjectRepositoryFileHere>"
i think 9.0 doesn't allow to load multiple OR..pls check once..

--
Mallipeddi Sreedhar
91-9848871279

Sreedhar Mallipeddi

unread,
May 7, 2009, 7:44:35 AM5/7/09
to Mercu...@googlegroups.com
or use this function
ublic 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
We can call the TSR file in runtime and in 8.2 and 9.0 
also.
--
Mallipeddi Sreedhar
91-9848871279
Reply all
Reply to author
Forward
0 new messages