Ask a Question

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

jenli
Contributor

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 1
YMinaev
Staff

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.

------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: