예제 #1
0
 public ScrollBars(AutomationElement automationElement, ActionListener actionListener,
     ScrollBarButtonAutomationIds hScrollBarButtonAutomationIds, ScrollBarButtonAutomationIds vScrollBarButtonAutomationIds) {
     this.actionListener = actionListener;
     this.hScrollBarButtonAutomationIds = hScrollBarButtonAutomationIds;
     this.vScrollBarButtonAutomationIds = vScrollBarButtonAutomationIds;
     finder = new AutomationElementFinder(automationElement);
 }
예제 #2
0
파일: ScrollBar.cs 프로젝트: EDOlsson/White
 protected ScrollBar(AutomationElement automationElement, IActionListener actionListener, ScrollBarButtonAutomationIds automationIds)
     : base(automationElement, actionListener)
 {
     this.automationIds = automationIds;
     var finder = new AutomationElementFinder(automationElement);
     primaryUIItemFactory = new PrimaryUIItemFactory(finder);
 }
예제 #3
0
 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
        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");
        }
예제 #10
0
 private AutomationElement FindModalWindowElement(string title, Process process, AutomationElementFinder windowFinder)
 {
     var windowElement = windowFinder.FindWindow(title, process.Id) ?? Finder.FindWindow(title, process.Id);
     return windowElement;
 }
예제 #11
0
파일: Tree.cs 프로젝트: EricBlack/White
 public Tree(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener)
 {
     finder = new AutomationElementFinder(automationElement);
 }
예제 #12
0
 public PropertyGridElementFinder(AutomationElement automationElement)
 {
     finder = new AutomationElementFinder(automationElement);
 }
예제 #13
0
 public ListViewFactory(AutomationElementFinder automationElementFinder, IActionListener actionListener)
 {
     this.automationElementFinder = automationElementFinder;
     this.actionListener = actionListener;
 }
예제 #14
0
 public ListViewRow(AutomationElement automationElement, ActionListener actionListener)
     : base(automationElement, actionListener)
 {
     header = null;
     finder = new AutomationElementFinder(automationElement);
 }
예제 #15
0
파일: Window.cs 프로젝트: spider09/White
 /// <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();
 }
예제 #16
0
 public ListViewHeader(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener)
 {
     automationElementFinder = new AutomationElementFinder(automationElement);
 }
예제 #17
0
파일: TitleBar.cs 프로젝트: EricBlack/White
 public TitleBar(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener)
 {
     automationElementFinder = new AutomationElementFinder(automationElement);
 }
예제 #18
0
파일: Desktop.cs 프로젝트: EDOlsson/White
 private Desktop(AutomationElement automationElement, IActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession)
     : base(automationElement, actionListener, initializeOption, windowSession)
 {
     finder = new AutomationElementFinder(automationElement);
 }
예제 #19
0
 public TableRowFactory(AutomationElementFinder automationElementFinder)
 {
     this.automationElementFinder = automationElementFinder;
 }
예제 #20
0
 public ListControl(AutomationElement automationElement, IActionListener actionListener)
     : base(automationElement, actionListener)
 {
     Finder = new AutomationElementFinder(automationElement);
 }
예제 #21
0
 public WPFListItem(AutomationElement automationElement, IActionListener actionListener)
     : base(automationElement, actionListener)
 {
     finder = new AutomationElementFinder(automationElement);
 }
예제 #22
0
 private AutomationElement FindModalWindowElement(SearchCriteria searchCriteria, AutomationElementFinder windowFinder)
 {
     var windowElement = windowFinder.FindWindow(searchCriteria) ?? Finder.FindWindow(searchCriteria);
     return windowElement;
 }
예제 #23
0
 protected ChildWindowFactory(AutomationElementFinder finder)
 {
     Finder = finder;
 }
예제 #24
0
        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);
            });
        }
예제 #25
0
파일: Window.cs 프로젝트: spider09/White
 //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);
 }
예제 #26
0
 private WindowFactory(AutomationElementFinder automationElementFinder)
     : base(automationElementFinder)
 {
 }
예제 #27
0
파일: TreeNode.cs 프로젝트: EDOlsson/White
 protected TreeNode(AutomationElement automationElement, IActionListener actionListener)
     : base(automationElement, actionListener)
 {
     finder = new AutomationElementFinder(automationElement);
 }
예제 #28
0
 /// <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);
 }
예제 #29
0
 public ListViewRow(AutomationElement automationElement, ActionListener actionListener, ListViewHeader header)
     : base(automationElement, actionListener)
 {
     this.header = header;
     finder = new AutomationElementFinder(automationElement);
 }
예제 #30
0
 /// <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);
 }
예제 #31
0
파일: Table.cs 프로젝트: EricBlack/White
 public Table(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener)
 {
     finder = new AutomationElementFinder(automationElement);
     tableRowFactory = new TableRowFactory(finder);
 }
예제 #32
0
 public PrimaryUIItemFactory(AutomationElementFinder finder) : base(finder) {}