Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a function for an object that has a large number of parent objects
#1
Not Solved
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)
    Select Case strAction
        Case "Click"
JavaWindow("objWindowDesc").JavaDialog("objDialogDesc").JavaButton(objButtonDesc).Click
    End Select
End Function

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?
Reply


Messages In This Thread
How to make a function for an object that has a large number of parent objects - by Shroomsday - 01-22-2014, 05:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Passing Object to Function Mozza 2 1,927 08-02-2018, 03:22 AM
Last Post: Mozza
  does WebTable Object provides a method to get column number umer830 4 13,046 07-06-2018, 09:32 AM
Last Post: vijaychourasiya0109@gmail.com
Question Is there a way to create dynamic objects by declaring the type of object as parameter lotos 3 2,236 11-08-2017, 11:15 PM
Last Post: lotos
  Problem with large webtable JoshS 0 1,824 08-26-2015, 04:04 AM
Last Post: JoshS
  QTP is not identifying Parent objects it self then how can we automate swapna.9n9 0 2,043 12-11-2014, 04:32 PM
Last Post: swapna.9n9

Forum Jump:


Users browsing this thread: 2 Guest(s)