I am automating Notepad as an example.
Currently, I can fire up Notepad. I want to click "File" then click "open". I am stuck on how to implement this.
I have tried the following code from documentation.
MenuBar menuBar = window.MenuBar;
Menu level2Menu = menuBar.MenuItem("Root", "Level1", "Level2");
However, it throws an error. When I put the breakpoint in the first line, I found it's failed.
Error msg is:
A QueryInterface call was made requesting the class interface of COM visible managed class 'MS.Internal.AutomationProxies.WindowsEditBox'. However since this class derives from non COM visible class 'MS.Internal.AutomationProxies.ProxyHwnd', the QueryInterface
call will fail. This is done to prevent the non COM visible base class from being constrained by the COM versioning rules.
Can anyone help me please? Thanks in advance.