public ScrollBars(AutomationElement automationElement, ActionListener actionListener, ScrollBarButtonAutomationIds hScrollBarButtonAutomationIds, ScrollBarButtonAutomationIds vScrollBarButtonAutomationIds) { this.actionListener = actionListener; this.hScrollBarButtonAutomationIds = hScrollBarButtonAutomationIds; this.vScrollBarButtonAutomationIds = vScrollBarButtonAutomationIds; finder = new AutomationElementFinder(automationElement); }
protected ScrollBar(AutomationElement automationElement, IActionListener actionListener, ScrollBarButtonAutomationIds automationIds) : base(automationElement, actionListener) { this.automationIds = automationIds; var finder = new AutomationElementFinder(automationElement); primaryUIItemFactory = new PrimaryUIItemFactory(finder); }
private void FindDescendantWindowElements(AutomationElementFinder windowFinder, Process process, List<AutomationElement> windowElements) { var children = windowFinder.Children(AutomationSearchCondition.ByControlType(ControlType.Window).WithProcessId(process.Id)); windowElements.AddRange(children); foreach (var automationElement in children) FindDescendantWindowElements(new AutomationElementFinder(automationElement), process, windowElements); }
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); }
private static ISuggestionList Find(IActionListener 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 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 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"); }
private AutomationElement FindModalWindowElement(string title, Process process, AutomationElementFinder windowFinder) { var windowElement = windowFinder.FindWindow(title, process.Id) ?? Finder.FindWindow(title, process.Id); return windowElement; }
public Tree(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
public PropertyGridElementFinder(AutomationElement automationElement) { finder = new AutomationElementFinder(automationElement); }
public ListViewFactory(AutomationElementFinder automationElementFinder, IActionListener actionListener) { this.automationElementFinder = automationElementFinder; this.actionListener = actionListener; }
public ListViewRow(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { header = null; finder = new AutomationElementFinder(automationElement); }
/// <summary> /// Recursively gets all the descendant windows. /// </summary> /// <returns></returns> /// <exception cref="UIItemSearchException">The application type is not supported by White</exception> // from ChildWindowFactory.Create public virtual List<Window> ModalWindows() { var finder = new AutomationElementFinder(automationElement); var descendants = finder.Descendants(AutomationSearchCondition.ByControlType(ControlType.Window)); return descendants .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache))) .ToList(); }
public ListViewHeader(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { automationElementFinder = new AutomationElementFinder(automationElement); }
public TitleBar(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { automationElementFinder = new AutomationElementFinder(automationElement); }
private Desktop(AutomationElement automationElement, IActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, actionListener, initializeOption, windowSession) { finder = new AutomationElementFinder(automationElement); }
public TableRowFactory(AutomationElementFinder automationElementFinder) { this.automationElementFinder = automationElementFinder; }
public ListControl(AutomationElement automationElement, IActionListener actionListener) : base(automationElement, actionListener) { Finder = new AutomationElementFinder(automationElement); }
public WPFListItem(AutomationElement automationElement, IActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
private AutomationElement FindModalWindowElement(SearchCriteria searchCriteria, AutomationElementFinder windowFinder) { var windowElement = windowFinder.FindWindow(searchCriteria) ?? Finder.FindWindow(searchCriteria); return windowElement; }
protected ChildWindowFactory(AutomationElementFinder finder) { Finder = finder; }
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); }); }
//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); }
private WindowFactory(AutomationElementFinder automationElementFinder) : base(automationElementFinder) { }
protected TreeNode(AutomationElement automationElement, IActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
/// <exception cref="UIItemSearchException">The application type is not supported by White</exception> public virtual Window FindModalWindow(string title, Process process, InitializeOption option, AutomationElement parentWindowElement, WindowSession windowSession) { var windowFinder = new AutomationElementFinder(parentWindowElement); var message = "Could not find modal window with title: " + title; var modalWindowElement = WaitTillFound(() => FindModalWindowElement(title, process, windowFinder), message); return Create(modalWindowElement, option, windowSession); }
public ListViewRow(AutomationElement automationElement, ActionListener actionListener, ListViewHeader header) : base(automationElement, actionListener) { this.header = header; finder = new AutomationElementFinder(automationElement); }
/// <exception cref="UIItemSearchException">The application type is not supported by White</exception> public virtual Window FindModalWindow(SearchCriteria searchCriteria, InitializeOption option, AutomationElement parentWindowElement, WindowSession windowSession) { var windowFinder = new AutomationElementFinder(parentWindowElement); var message = "Could not find modal window with SearchCriteria: " + searchCriteria; var modalWindowElement = WaitTillFound(() => FindModalWindowElement(searchCriteria, windowFinder), message); return Create(modalWindowElement, option, windowSession); }
public Table(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); tableRowFactory = new TableRowFactory(finder); }
public PrimaryUIItemFactory(AutomationElementFinder finder) : base(finder) {}