Forum Discussion

jenli's avatar
jenli
Contributor
15 years ago

What is the difference between WPFObject and the program objectslike WPFMenu?

for the following Menu WPF object, I can either use

menu = mainFormClass.WPFObject("MainMenu");


menu.WPFMenu.Click("File|New"); or

menu.Click("File|New");



  When I do the script recording, I see that the most situaion, TestComplete  records the Button Click as:

WPFObject("YesBtn").ClickButton() instead of WPFObject("YesBtn").WPFButton.ClickButton().



  How should  those special program objects (such as" WPFMenu,  and WPFButton, etc) used in my scripts?


1 Reply

  • Hi,



    The WPFMenu property returns the Menu object. It is a wrapper object for the menu which allows working with it in the standard way. This is impossible if you just obtain your menu by its name, and you need to get the standard interface from its object.



    As for such controls as buttons, etc, you can work with them as with standard Win32 controls, and you don't have to use any special objects to do this.