protected ScrollBar(AutomationElement automationElement, ActionListener actionListener, ScrollBarButtonAutomationIds automationIds) : base(automationElement, actionListener) { this.automationIds = automationIds; var finder = new AutomationElementFinder(automationElement); primaryUIItemFactory = new PrimaryUIItemFactory(finder); }
public ScrollBars(AutomationElement automationElement, ActionListener actionListener, ScrollBarButtonAutomationIds hScrollBarButtonAutomationIds, ScrollBarButtonAutomationIds vScrollBarButtonAutomationIds) { this.actionListener = actionListener; this.hScrollBarButtonAutomationIds = hScrollBarButtonAutomationIds; this.vScrollBarButtonAutomationIds = vScrollBarButtonAutomationIds; finder = new AutomationElementFinder(automationElement); }
private static SuggestionList Find(ActionListener actionListener) { AutomationElement dropDown = new AutomationElementFinder(AutomationElement.RootElement).Child(AutomationSearchCondition.ByClassName("Auto-Suggest Dropdown")); if (dropDown == null) return null; AutomationElement listViewElement = new AutomationElementFinder(dropDown).Child(AutomationSearchCondition.ByControlType(ControlType.DataGrid)); if (listViewElement == null) return null; return new ListView(listViewElement, actionListener); }
public TableScrollBars(AutomationElementFinder finder, ActionListener actionListener, TableVerticalScrollOffset tableVerticalScrollOffset) { AutomationElement verticalScrollElement = finder.Child(AutomationSearchCondition.ByControlType(ControlType.Pane).OfName(UIItemIdAppXmlConfiguration.Instance.TableVerticalScrollBar)); verticalScrollBar = (verticalScrollElement == null) ? (IVScrollBar) new NullVScrollBar() : new TableVerticalScrollBar(verticalScrollElement, actionListener, tableVerticalScrollOffset); AutomationElement horizontalScrollElement = finder.Child(AutomationSearchCondition.ByControlType(ControlType.Pane).OfName(UIItemIdAppXmlConfiguration.Instance.TableHorizontalScrollBar)); horizontalScrollBar = (horizontalScrollElement == null) ? (IHScrollBar) new NullHScrollBar() : new TableHorizontalScrollBar(horizontalScrollElement, actionListener); }
public virtual AutomationElement Find(int returnLevel, AutomationElement startElement) { AutomationElement currentElement = startElement; AutomationElement automationElementAtReturnLevel = null; for (int i = 0; i < searchConditions.Length; i++) { var currentFinder = new AutomationElementFinder(currentElement); AutomationElement childElement = currentFinder.Child(searchConditions[i]); if (childElement == null) return null; currentElement = childElement; if (i == returnLevel) automationElementAtReturnLevel = childElement; } return automationElementAtReturnLevel; }
public virtual List<AutomationElement> FindAll(AutomationElement startElement) { AutomationElement currentElement = startElement; for (int i = 0; i < searchConditions.Length; i++) { var currentFinder = new AutomationElementFinder(currentElement); if (i == searchConditions.Length - 1) return currentFinder.Children(searchConditions[i]); AutomationElement childElement = currentFinder.Child(searchConditions[i]); currentElement = childElement; if (childElement == null) return null; } throw new WhiteAssertionException("Something wrong in logic here"); }
public virtual Window FindModalWindow(string title, Process process, InitializeOption option, AutomationElement parentWindowElement, WindowSession windowSession) { var windowFinder = new AutomationElementFinder(parentWindowElement); try { AutomationElement modalWindowElement = WaitTillFound(delegate { AutomationElement windowElement = windowFinder.FindWindow(title, process.Id) ?? finder.FindWindow(title, process.Id); return windowElement; }, "Could not find modal window with title: " + title); return Create(modalWindowElement, option, windowSession); } catch (UIActionException e) { WhiteLogger.Instance.Debug(e.ToString()); return null; } }
public virtual AutomationElement Find(int returnLevel, AutomationElement startElement) { AutomationElement currentElement = startElement; AutomationElement automationElementAtReturnLevel = null; for (int i = 0; i < searchConditions.Length; i++) { var currentFinder = new AutomationElementFinder(currentElement); AutomationElement childElement = currentFinder.Child(searchConditions[i]); if (childElement == null) { return(null); } currentElement = childElement; if (i == returnLevel) { automationElementAtReturnLevel = childElement; } } return(automationElementAtReturnLevel); }
public virtual List <AutomationElement> FindAll(AutomationElement startElement) { AutomationElement currentElement = startElement; for (int i = 0; i < searchConditions.Length; i++) { var currentFinder = new AutomationElementFinder(currentElement); if (i == searchConditions.Length - 1) { return(currentFinder.Children(searchConditions[i])); } AutomationElement childElement = currentFinder.Child(searchConditions[i]); currentElement = childElement; if (childElement == null) { return(null); } } throw new WhiteAssertionException("Something wrong in logic here"); }
protected TreeNode(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
public Table(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); tableRowFactory = new TableRowFactory(finder); }
public TitleBar(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { automationElementFinder = new AutomationElementFinder(automationElement); }
public virtual Window FindModalWindow(SearchCriteria searchCriteria, InitializeOption option, AutomationElement parentWindowElement, WindowSession windowSession) { var windowFinder = new AutomationElementFinder(parentWindowElement); try { AutomationElement modalWindowElement = WaitTillFound(() => { AutomationElement windowElement = windowFinder.FindWindow(searchCriteria) ?? Finder.FindWindow(searchCriteria); return windowElement; }, "Could not find modal window with SearchCriteria: " + searchCriteria); return Create(modalWindowElement, option, windowSession); } catch (UIActionException e) { logger.Debug(e.ToString()); return null; } }
private AutomationElement FindWindowElement(Process process, Predicate<string> match) { var elements = FindAllWindowElements(process); return elements.Find(automationElement => { if (match.Invoke(automationElement.Current.Name)) return true; AutomationElement titleBarElement = new AutomationElementFinder(automationElement).Child(AutomationSearchCondition.ByControlType(ControlType.TitleBar)); if (titleBarElement == null) return false; return match.Invoke(titleBarElement.Current.Name); }); }
private Desktop(AutomationElement automationElement, ActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, actionListener, initializeOption, windowSession) { finder = new AutomationElementFinder(automationElement); }
public ListControl(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
public ListViewFactory(AutomationElementFinder automationElementFinder, ActionListener actionListener) { this.automationElementFinder = automationElementFinder; this.actionListener = actionListener; }
private WindowFactory(AutomationElementFinder automationElementFinder) : base(automationElementFinder) { }
public PrimaryUIItemFactory(AutomationElementFinder finder) : base(finder) { }
public TableRowFactory(AutomationElementFinder automationElementFinder) { this.automationElementFinder = automationElementFinder; }
internal Tree(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
public ListViewHeader(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { automationElementFinder = new AutomationElementFinder(automationElement); }
public Spinner(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
private void FindDescendantWindowElements(AutomationElementFinder windowFinder, Process process, BricksCollection<AutomationElement> windowElements) { List<AutomationElement> children = windowFinder.Children(AutomationSearchCondition.ByControlType(ControlType.Window).WithProcessId(process.Id)); windowElements.AddRange(children); foreach (AutomationElement automationElement in children) FindDescendantWindowElements(new AutomationElementFinder(automationElement), process, windowElements); }
/// <summary> /// Recursively gets all the descendant windows. /// </summary> /// <returns></returns> public virtual List<Window> ModalWindows() { var modalWindows = new List<Window>(); var finder = new AutomationElementFinder(automationElement); var descendants = finder.Descendants(AutomationSearchCondition.ByControlType(ControlType.Window)); foreach (AutomationElement descendant in descendants) modalWindows.Add(ChildWindowFactory.Create(descendant, InitializeOption.NoCache, windowSession.ModalWindowSession(InitializeOption.NoCache))); return modalWindows; }
private AutomationElement FindWindowElement(Process process, Predicate<string> match) { BricksCollection<AutomationElement> elements = FindAllWindowElements(process); return elements.Find(delegate(AutomationElement obj) { if (match.Invoke(obj.Current.Name)) return true; AutomationElement titleBarElement = new AutomationElementFinder(obj).Child(AutomationSearchCondition.ByControlType(ControlType.TitleBar)); if (titleBarElement == null) return false; return match.Invoke(titleBarElement.Current.Name); }); }
public ListViewRow(AutomationElement automationElement, ActionListener actionListener, ListViewHeader header) : base(automationElement, actionListener) { this.header = header; finder = new AutomationElementFinder(automationElement); }
public PropertyGridElementFinder(AutomationElement automationElement) { finder = new AutomationElementFinder(automationElement); }
//TODO: Position based find should understand MdiChild /// <summary> /// Returns a UIItemContainer using which other sub-ui items can be retrieved. /// Since there is no single standard identification for MdiChild windows, hence it is has been left open for user. /// </summary> /// <param name="searchCriteria"></param> /// <returns></returns> public virtual UIItemContainer MdiChild(SearchCriteria searchCriteria) { var finder = new AutomationElementFinder(automationElement); AutomationElement element = finder.Descendant(searchCriteria.AutomationCondition); return element == null ? null : new UIItemContainer(element, this, InitializeOption.NoCache, windowSession); }
protected ChildWindowFactory(AutomationElementFinder finder) { this.finder = finder; }
public WPFListItem(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }