I want to
Associate these functions to objects
Make them to appear in object's intellisense dropdown.
I want to create a function called VerifyEnabled and associate this function to web object WebEdit and this function should appear in the intellisense dropdown so that I can use this function as, Browser("oBrowser")Page("oPage").WebEdit("oWebEdit ").VerifyEnabled()
I know the above is possible. Please help me to find out how.
Also help me to understand how can I get information about objects which are calling this function inside the function.
Any information towards my question is going to be helpful for me.
Look at RegisterUserFunc method in QTP help file
Tarun Buy the NEW QTP Descriptive Programming Unplugged Book ** Download QTP Unplugged 2nd Edition eBook for FREE **
You can find this method via Insert -> Function Definition GEnerator.
This is not a recommended way to be used, because you have to spend lots of time to maintain them one by one in the future. Hard to find the correct one if there is no file to map them.
For your second question,What is your code in the function, does it refer to any object?
I would still prefer using this a function call passing objects instead of registering it as a method, this would solve your second issue right away
-- Here to Learn and share ---