When using UIAutomation, I seem to be unable to get a link to the context menu that appears when I execute a right-click command.
The following example shows the case when I opened a new window using (Windows Explorer inside it), got the correct link from the available DesktopWindows (note that I can move it in order) and called up the context menu via the right -Click.
var windowName = "This is a WinForms window: {0}".format(3.randomLetters()); var topPanel = O2Gui.open<Panel>(windowName,600,200 ); var webBrowser = topPanel.add_WebBrowser_Control(); webBrowser.open("".o2Temp2Dir()); var guiAutomation = new API_GuiAutomation(); var window = guiAutomation.desktopWindow(windowName); window.move(0,0); window.mouse_MoveTo(); guiAutomation.mouse().rightClick(); window.infoTypeName(); return window.Popup;
I tried using the window.Popup variable to get the popup, but it was null (not that the window object is of type White.Core.UIItems.WindowItems.WinFormWindow
source share