Reset Object repository at run time

448 views
Skip to first unread message

Santosh S

unread,
Mar 5, 2012, 7:08:13 AM3/5/12
to QTP - HP Quick Test Professional - Automated Software Testing
Hi,

Can some one help me on this.

We need to reset object repository at run time ie once the script is
loaded at run time,i need to deactivate/activate object repository
based on the switch of scripts running on web-application and non web-
application.Hence,my question boils down to whether we can do the
switch by loading/unloading the object repository at run time when the
script loads.Can anyone kindly help on this?

gopi nath

unread,
Mar 5, 2012, 10:39:51 AM3/5/12
to mercu...@googlegroups.com
Hi,'
 
 
Try this, it will load the Repository at run time only.
RepositoriesCollection.Add <repository path>
 
 
Thanks
Gopinath
 

 

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Chethana KP

unread,
Mar 5, 2012, 11:14:22 PM3/5/12
to mercu...@googlegroups.com, santos...@gmail.com
Hello,

You can try the following methods according to your necessary
 
RepositoriesCollection.RemoveAll()
RepositoriesCollection.Add(RepPath)
Pos = RepositoriesCollection.Find(RepPath)
RepositoriesCollection.Remove(Pos)
RepositoriesCollection.Add(RepPath)
Window("Microsoft Word").WinObject("Microsoft Word Document").Click
Pos = RepositoriesCollection.Find(RepPath)
 
~Chets
On Mon, Mar 5, 2012 at 5:38 PM, Santosh S <santos...@gmail.com> wrote:

udaykumar vutukuru

unread,
Mar 6, 2012, 12:45:16 AM3/6/12
to mercu...@googlegroups.com
Hi Santosh

There are three types to associating the shared repository.
But we are using the method is

repositoriescollection.add "path of the .tsr file"

this code is running only in execution time.


Regards,

Uday

On 3/5/12, Chethana KP <chethu...@gmail.com> wrote:
> Hello,
>
> You can try the following methods according to your necessary
>
> RepPath =

> "\\Mercury\SORS\MySharedObjectRepository.tsr<file://mercury/SORS/MySharedObjectRepository.tsr>"

Santosh S

unread,
Mar 9, 2012, 3:05:46 AM3/9/12
to Mercu...@googlegroups.com

All,
 
Thanks for the solution you have provided.To put my requirement in other words:

1) I need to delete the object repository programmatically ie once the script is loaded i need to delete the object repository programmatically so that the scripts no longer recognise the objects and the script should refer to the HTML DOM for execution.

For Eg:

Window("Microsoft Word").WinObject("Microsoft Word Document").Click : this line of code should be executed successfully without referring to the object repository but by referring to HTML DOM identifiers directly.So basically i would like to have a script which deletes the object repository once the script is loaded in the QTP editor,so that the HTML DOM is referenced for identifiers(for each object like Window,WinObject we write a method/function which has HTML identifiers so that the script runs thus masking object repository.)

We tried to delete the object repository(script.mtr) and then load the script,but the script doesn't load.So we are looking for a way to delete the object repository programmatically once the script is loaded in the qtp editor.Could you kindly help ?

Thanks
Santosh

santhosh Ganji

unread,
Mar 9, 2012, 6:08:46 AM3/9/12
to mercu...@googlegroups.com
Actually the repository file will be .bdb...
And you can delete(Remove) the repository in runtime by using RepositoriesCollection utility object.
This object provide you different methods like add, remove etc.
by using this object you can remove the OR from the script dynamically.
Thanks and Reagards
Santhosh G
+918007850250


Santosh S

unread,
Mar 12, 2012, 3:51:30 AM3/12/12
to mercu...@googlegroups.com
Hi,

Couple of questions:
1) Assume we have a script "a"
2) Load the script "a" and then use RepositoriesCollection utility to remove the repository at run time.Run the scripts bypassing the object repository through user written code/functions.
3)After the script completes execution,reload the deleted object repository.
4)Can this be done programmatically and at run time,and if yes can someone tell the logic?

Thanks
Santosh
Reply all
Reply to author
Forward
0 new messages