Micro Focus QTP (UFT) Forums

Full Version: Want to copy object from 1 repository to another
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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)
@falvi

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