Need to call function from another function (locates not at the same lib)
' something here
' some code here
func1 ' call to the function from another lib
The call to func1 or func2 can be done without problem from any Action of QTP test.
Don't understand your problem...
If you want to call this functions any action level you can attach this two fucntions in File/Settings/Library....
maybe additional description:
The test can contains:
Actions (with attached repositories)
Libraries : here list of different functions that normally universal and they calling from different tests.
The usual behavior:
somewhere inside Action1 we call DoMyFunc (DoMyFunc defined in Library1)
What I would like to do : create another function (in Library2) and this function will be called by DoMyFunc
or it can be represented like this:
Test_Action1 -> Lib1_DoMyFunc -> Lib2_DoMore
P.S. please do not advice to put 2 functions at the same library
As suggested by Kishore, please associate the libraries into the resources of the QTP script.
All associated libraries are combined and run into one scope. So you won't have problem calling functions across libraries or action.
In case you want to make things dynamic then you can load the library at run-time using ExecuteFile statement
Tarun Buy the NEW QTP Descriptive Programming Unplugged Book ** Download QTP Unplugged 2nd Edition eBook for FREE **
I avoid all these problems by never using actions, only function libraries. I've been using QTP for many years now and I'm still yet to find any instance where using reusable actions is beneficial.
Check this http://qtp.blogspot.com/2009/10/executeglobal.html
-- Here to Learn and share ---
ExecuteFile good when library not defined for the test. At my case - I added lib to the test's resources, because Action has access to the functions from lib
Sorry, this solution does not work