How to make a function for an object that has a large number of parent objects - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: How to make a function for an object that has a large number of parent objects (/Thread-How-to-make-a-function-for-an-object-that-has-a-large-number-of-parent-objects) |
How to make a function for an object that has a large number of parent objects - Shroomsday - 01-22-2014 Hi. I want a function that will use method on an object depending on the function parameters. For example: Code: Public Function fnJavaButton (objWindowDesc, objDialogDesc, objButtonDesc, strAction) The problem is that the number of parent objects can vary from one to seven. Should I add five more object parameters and an int parameter, that indicates how many parent objects is before the button? Is there any way to make that kind of function without adding a large number of parameters? RE: How to make a function for an object that has a large number of parent objects - jacosta - 01-28-2014 Hi, try this: Code: PUBLIC FUNCTION CreateObjDes(ObjectFatherUFT,StrObjectClass,StrObjectProperty,StrObjectPropertyValue) |