How to get Screenshot of Popup Menu

May 28, 2012 at 10:29 AM

Hi !

We are building a new WPF-Clientapplication at work and corresponding automation-tests.

White eases a lot of the task, only the behavior concerning popup menus seems to be funny... We use both split buttons (in our ribbon bar) and context menus on tree items which we can automate, but not screenshot for logging.

Both screenshots of the whole desktop using Desktop.Instance.VisibleImage or mainWindow.visibleImage don't show these menus (but everything else):

PopUpMenu ctxPopUpMenu = mainWindow.Popup;

System.Threading.Thread popupScreenr = new System.Threading.Thread(new System.Threading.ThreadStart(DmndScreener)); //saves Desktop.Instance.VisibleImage

White.Core.UIItems.MenuItems.Menu ctxMenu = ctxPopUpMenu.Items[1];
WPFListener.getInstance().addComment(@"AblagenNode > Open Deckblatt");
ctxMenu.Click(); //menuitem in use but not on the screenshots

As mentioned before, we can click the menu item but can't seem to get a screener of it. We already tried System.Drawing.Graphics.CopyFromScreen which also produced a complete screenshot of the Application but without the popup...

Has anyone run into this kind of situation and can give any advice ? Google doesn't have any results on this, as if we're the only ones with that kind of problem.

Thanks a lot in advance !