Micro Focus QTP (UFT) Forums
Referencing Object Repository from Function Library - 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: Referencing Object Repository from Function Library (/Thread-Referencing-Object-Repository-from-Function-Library)



Referencing Object Repository from Function Library - SwissSteve - 12-17-2009

I have a number of common operations that I regulary perform in my test scripts like StartApp, StopApp, Login etc.

I would like to collect these together into a QTP function Library.

How do i associate the Object Repository to the Fuction Library and to reference the objects in the repository in my scripts ?

TIA


RE: Referencing Object Repository from Function Library - rdemers25 - 12-17-2009

If I'm not mistaken, the Object Repository is associated with the test not with the function library. You would associate the Function Library to the Test and then you can use those functions in the test and also the Object Repository.


RE: Referencing Object Repository from Function Library - SwissSteve - 12-18-2009

Yes but in my case I want to have QTP recorded operation in the function Login.

So I guess the function library needs to then know about the Object Repository.
The Test Case would just call a function called Login in the function library and the Login screen operation would occur.

I suppose the question is if it is really valid to have function library's that contain recorded actions?


RE: Referencing Object Repository from Function Library - Ankur - 12-18-2009

I would prefer to keep things simple in such cases and would use Descriptive Programming to write statements in function library.
No OR, therefore no association required.


RE: Referencing Object Repository from Function Library - anandanlk - 02-03-2011

Hi,
Use Function Library with Shared Object Repository(SOR)
or
Use Function Library with Descriptive Programming

in the 1st case Associate SOR to the actions whenever you use the library function



RE: Referencing Object Repository from Function Library - DinakarVadapalli - 02-03-2011

Hi...use the below code
Code:
Set qtRepositories = oApp.Test.Actions.item(1).ObjectRepositories  

    qtRepositories.RemoveAll()
qtRepositories.Add "C:\ObjRep.tsr"

u can give ur desired shared OR path