public override Window ModalWindow(string title, InitializeOption option)
        {
            WindowFactory desktopWindowsFactory = WindowFactory.Desktop;

            return(desktopWindowsFactory.FindModalWindow(title, Process.GetProcessById(automationElement.Current.ProcessId), option, automationElement,
                                                         WindowSession.ModalWindowSession(option)));
        }
Пример #2
0
        /// <summary>
        /// Get the MessageBox window launched by this window
        /// </summary>
        /// <param name="title">Title of the messagebox</param>
        /// <returns></returns>
        public virtual Window MessageBox(string title)
        {
            Window window = factory.ModalWindow(title, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache));

            window.actionListener = this;
            return(window);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
        //TODO Try and get this working
        //public override List<Window> ModalWindows()
        //{
        //    var automationSearchConditions = new AutomationSearchConditionFactory()
        //        .GetWindowSearchConditions(automationElement.Current.ProcessId)
        //        .ToArray();

        //    var descendants = new AutomationElementFinder(automationElement)
        //        .Children(automationSearchConditions);

        //    return descendants
        //        .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache)))
        //        .ToList();
        //}

        public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
        {
            return(windowFactory.ModalWindow(searchCriteria, option, WindowSession.ModalWindowSession(option)));
        }
Пример #5
0
        /// <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());
        }
Пример #6
0
        public override List <Window> ModalWindows()
        {
            var descendants = new AutomationElementFinder(automationElement)
                              .Children(new AutomationSearchConditionFactory().GetWindowSearchConditions(automationElement.Current.ProcessId).ToArray());

            return(descendants
                   .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache)))
                   .ToList());
        }
Пример #7
0
 public override Window ModalWindow(string title, InitializeOption option)
 {
     return(factory.ModalWindow(title, option, WindowSession.ModalWindowSession(option)));
 }
        public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
        {
            WindowFactory desktopWindowsFactory = WindowFactory.Desktop;

            return(desktopWindowsFactory.FindModalWindow(searchCriteria, option, automationElement, WindowSession.ModalWindowSession(option)));
        }
Пример #9
0
 public override Window ModalWindow(string title, InitializeOption option)
 {
     return(windowFactory.FindModalWindow(title, Process.GetProcessById(automationElement.Properties.ProcessId), option, automationElement,
                                          WindowSession.ModalWindowSession(option)));
 }