This project is read-only.

CUITe and hierarchy + smart match options

Jun 17, 2013 at 8:58 PM
Hi,

I've built my code similar to the hierarchy (using the core windows and controls to find a specific element I want to interact with). For example

class Window : CUITe_WinWindow
which has a property for a menu bar class
public Menubar menuBar {{ get { return this.get<MenuBar>(); }}}

class MenuBar : CUITe_MenuBar
which as a property for a button
public CUITe_Winbutton button {{ get { return this.get<CUITe_WinButton>("Name=xyz") }}

Now, this might not be the exact hierarchy (there tends to be many unnecessary levels that you don't want to code in) but the idea is I'm trying to organize my code and make the look ups efficient.

I like to use SmartMatchOptions = None to make sure that I'm typing everything in correctly but I noticed that if I mis-spell the top level window name, it will still find the button even though I'm calling this.Window.MenuBar.Button.Click();

To me, that doesn't make sense because shouldn't it attempt to find the window first and therefore fail because I've misspelt the window name?
Jul 16, 2013 at 8:15 AM
Hi ddoorn,

Can you provide the code that defines class Window : CUITe_WinWindow?

Thank you.
Jul 16, 2013 at 3:36 PM
Hi,

I forgot to reply to this thread earlier, I'm no longer having this issue. It appears to be related to my structure, I discovered that VS was having some searching issues and finding the wrong components early on and that for some reason was causing the problems.

This is no longer an issue for me, thanks for replying though.