Use windows invokaing to select the menu item

Namespace:  QAliber.Engine.Controls.UIA
Assembly:  QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public void Invoke()
Visual Basic (Declaration)
Public Sub Invoke
Visual C++
public:
virtual void Invoke() sealed

Examples

CopyC#
System.Diagnostics.Process.Start("notepad");
UIAWindow notepadWin = Desktop.UIA[@"Untitled - Notepad", @"Notepad", @"UIAWindow"] as UIAWindow;
UIAMenuItem fileMenue = notepadWin[@"Application", @"", @"MenuBar"][@"File", @"", @"Item 1"] as UIAMenuItem;
fileMenue.Expand();
System.Threading.Thread.Sleep(3000);
if (fileMenue.ExpandCollapseState == System.Windows.Automation.ExpandCollapseState.Expanded);
UIAMenuItem pageItem = fileMenue[@"File", @"#32768", @"UIAMenu"][@"Page Setup...", @"", @"Item 5"] as UIAMenuItem;
pageItem.Invoke();

See Also