Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to associate Function Libraries, OR's during Run Time?
#1
Smile 
Can anyone breif me ,How to associate Function Libraries, OR's during Run Time?
Reply
#2
Hi ,

You can associate Func. Libraries using 'AOM' & OR's by using 'RepositoriesCollection' during RunTime.

Search in the forums , you can get it.
Reply
#3
At run-time, libraries cannot be associated with a test. You will have to use one of the Execute (ExecuteFile, ExecuteGlobal) functions to load them dynamically.
Reply
#4
Hi Anshoo,

Could you please provide us the code to load functions dynamically.

Thanks,
Azeem
Reply
#5
Hi,

Use following code example for excuting function from library.

Code:
'Use executefile function to load library files. 'Example: executefile "C:\Documents and Settings\tsheth\Desktop\Sample123.vbs" x=50 y=50 result=Sum(x,y) msgbox(result) 'Code in External Library file(.vbs file). Public function Sum(a,b) Dim sum sum=a+b Sum=sum End Function
Reply
#6
Hi Tarik,

Thanks for your code, how to load OR's(more than one) dynamically at run time to a test.

Thanks
Azeem
Reply
#7
Hi,

To associate Object repository dynamically use the following code.
Try this for attaching Object repository at run time.

Code:
Dim qtpApp Set qtpApp = CreateObject("QuickTest.Application") Dim qtpRepositories Set qtpRepositories = qtApp.Test.Actions("Main").ObjectRepositories qtpRepositories.Add("C:\ts.tsr")
Reply
#8
There is another easy of doing the same using 'RepositoriesCollection.Add'

I feel we should avoid using QuickTest application object during runtime

Reply
#9
@Tarik @Saket - Thanks for the Code both are working fine, But I want upload repositories dynamically using the "ObjectRepositoryUtil" object

Could you please let me know how to use the above object to load.

Thanks,
Azeem
Reply
#10
Hi Azeem,

Please open a new thread for your new question.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP not recogonising object during run time Lavanya N 2 4,298 10-28-2015, 12:46 PM
Last Post: vinod123
  Writing to Run time data table Neetha 5 13,197 08-27-2015, 10:18 AM
Last Post: supputuri
  Calling a function in a Test Script from a function library anupam4j 3 6,993 06-26-2015, 12:31 AM
Last Post: babu123
  QTP Takes Long time to Run prasaad44 4 5,644 04-10-2014, 01:53 AM
Last Post: prasaad44
  Getting run error passing a Frame into a user defined function!!! sepgs2004 1 3,306 10-14-2013, 06:37 PM
Last Post: anil2u

Forum Jump:


Users browsing this thread: 1 Guest(s)