Identify forms by their methods
I am writing a script to compare builds of the same application. It exercises each menu option then notes the form, dialog or application that opens. The form is sometimes a different application and not necessarily a child of the application being tested.
I want to be able to identify the form object.
Currently I am looking for the system object that has focus
set focusObject = sys.findchild("Focused", TRUE, 100)
As this could be a button on the form, and not the form itself, I then want to loop up through parent objects until I find one with a close method.
Is there a way to test an object to see if it has a particular method?
Is there a better way of doing this altogether? Something like sys.Desktop.ActiveWindow or sys.Desktop.FocusedWindow but for a form or dialog.