Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Referencing Object Repository from Function Library
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
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
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
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.
Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
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?
Reply
#4
Solved: 11 Years, 4 Months, 4 Weeks ago
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.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#5
Solved: 11 Years, 4 Months, 4 Weeks ago
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
Reply
#6
Solved: 11 Years, 4 Months, 4 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Do we need object repository?? subhashinid 0 1,990 07-06-2016, 10:07 AM
Last Post: subhashinid
  Object repository losing object properties ishan.mahajan@adp.com 2 3,816 08-20-2015, 11:33 PM
Last Post: ADITI1992
  Calling a function in a Test Script from a function library anupam4j 3 6,180 06-26-2015, 12:31 AM
Last Post: babu123
  login object not found in object repository Akram 2 3,137 06-01-2015, 07:47 PM
Last Post: babu123
  object was not found in the Object Repository reynard 0 6,891 03-17-2015, 10:54 PM
Last Post: reynard

Forum Jump:


Users browsing this thread: 1 Guest(s)