public void GetPopupMenuItems() { window.Get <ListBox>("listBox").RightClick(); PopUpMenu popup = window.Popup; Assert.AreEqual(1, popup.Items.Count); }
public virtual bool TryGetPopupMenu(ActionListener actionListener, out PopUpMenu popUpMenu) { var searchConditions = new[] {AutomationSearchCondition.ByControlType(ControlType.Menu).OfName("DropDown")}; return TryGetPopupMenu(searchConditions, actionListener, out popUpMenu); }
private bool TryGetPopupMenu(AutomationSearchCondition[] searchConditions, ActionListener actionListener, out PopUpMenu popUpMenu) { var element = Retry.For(() => Finder.Child(searchConditions), CoreAppXmlConfiguration.Instance.PopupTimeout(), TimeSpan.FromMilliseconds(100)); if (element == null) { popUpMenu = null; return false; } popUpMenu = new PopUpMenu(element, actionListener); return true; }
private bool TryGetPopupMenu(AutomationSearchCondition[] searchConditions, ActionListener actionListener, out PopUpMenu popUpMenu) { var clock = new Clock(CoreAppXmlConfiguration.Instance.PopupTimeout, 100); Clock.Do @do = () => finder.Child(searchConditions); Clock.Matched matched = obj => obj != null; var element = (AutomationElement) clock.Perform(@do, matched, () => null); if (element == null) { popUpMenu = null; return false; } popUpMenu = new PopUpMenu(element, actionListener); return true; }