Micro Focus QTP (UFT) Forums
Want to copy object from 1 repository to another - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Want to copy object from 1 repository to another (/Thread-Want-to-copy-object-from-1-repository-to-another)



Want to copy object from 1 repository to another - Amol - 06-01-2012

Hi All,

I am new to QTP.

I want to copy object from one repository ;edit its properties and add it to another repository.
In QTP editor I have added the following code:
Code:
Dim RepositoryFrom, RepositoryTo

Set RepositoryFrom = CreateObject("Mercury.ObjectRepositoryUtil")
Set RepositoryTo = CreateObject("Mercury.ObjectRepositoryUtil")

RepositoryFrom.Load "C:\QuickTest\Tests\Flights.tsr"
RepositoryTo.Load "E:\Temp\Tests\Default.tsr"

RepositoryFrom.copyObject(?????)
Can you guide how to proceed further.

Regards,
Amol


RE: Want to copy object from 1 repository to another - falvi - 06-01-2012

go to resources menu > select object repository manager > open both repositories, and simply drag and drop the object from one to the other, and edit it's properties.
(do remember to enable the editing first for both repositories)


RE: Want to copy object from 1 repository to another - Amol - 06-01-2012

@falvi

I want to do it programmatically.


RE: Want to copy object from 1 repository to another - falvi - 06-01-2012

that'll be new for me as well... looking forward to see a solution... sorry can not be of help in this regard.