Esempio n. 1
0
 public SilverlightDocument(AutomationElement automationElement, BrowserWindow actionListener,
                            InitializeOption initializeOption,
                            WindowSession windowSession)
     : base(automationElement, actionListener, initializeOption, windowSession)
 {
     ieWindow = actionListener;
 }
Esempio n. 2
0
        public virtual WindowSession WindowSession(InitializeOption initializeOption)
        {
            if (initializeOption.Identifier == null) return new NullWindowSession();

            WindowSession windowSession;
            if (windowSessions.TryGetValue(initializeOption.Identifier, out windowSession)) return windowSession;

            windowSession = new WindowSession(this, initializeOption);
            windowSessions.Add(initializeOption.Identifier, windowSession);
            return windowSession;
        }
Esempio n. 3
0
        /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
        internal static Window Create(AutomationElement element, InitializeOption option, WindowSession windowSession)
        {
            SpecializedWindowFactory specializedWindowFactory = SpecializedWindowFactories.Find(factory => factory.DoesSpecializeInThis(element));
            if (specializedWindowFactory != null)
            {
                return specializedWindowFactory.Create(element, option, windowSession);
            }

            var windowsFramework = WindowsFrameworkExtensions.FromFrameworkId(element.Current.FrameworkId);
            if (windowsFramework == WindowsFramework.WinForms) return new WinFormWindow(element, option, windowSession);
            if (windowsFramework == WindowsFramework.Wpf) return new WPFWindow(element, WindowFactory.Desktop, option, windowSession);
            if (windowsFramework == WindowsFramework.Win32) return new Win32Window(element, WindowFactory.Desktop, option, windowSession);
            throw new UIItemSearchException(string.Format("{0} is not supported yet.", windowsFramework));
        }
        public virtual WindowSession WindowSession(InitializeOption initializeOption)
        {
            if (initializeOption.Identifier == null)
            {
                return(new NullWindowSession());
            }

            WindowSession windowSession;

            if (windowSessions.TryGetValue(initializeOption.Identifier, out windowSession))
            {
                return(windowSession);
            }

            windowSession = new WindowSession(this, initializeOption);
            windowSessions.Add(initializeOption.Identifier, windowSession);
            return(windowSession);
        }
Esempio n. 5
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);
 }
Esempio n. 6
0
 public virtual Window Create(AutomationElement automationElement, InitializeOption initializeOption, WindowSession session)
 {
     return new FirefoxWindow(automationElement, WindowFactory.Desktop, initializeOption, session);
 }
Esempio n. 7
0
 protected Window(AutomationElement automationElement, ActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession)
     : base(automationElement, actionListener, initializeOption, windowSession)
 {
     InitializeWindow();
     minOpenTime = Task.Factory.StartNew(() => Thread.Sleep(500));
 }
Esempio n. 8
0
 protected Window(AutomationElement automationElement, InitializeOption initializeOption, WindowSession windowSession)
     : this(automationElement, new NullActionListener(), initializeOption, windowSession)
 {
 }
Esempio n. 9
0
 public virtual Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option, WindowSession windowSession)
 {
     var message = "Could not find modal window with SearchCriteria: " + searchCriteria;
     var modalWindowElement = WaitTillFound(() => Finder.FindWindow(searchCriteria), message);
     return Create(modalWindowElement, option, windowSession);
 }
Esempio n. 10
0
 public virtual Window ModalWindow(string title, InitializeOption option, WindowSession windowSession)
 {
     var message = "Could not find modal window with title: " + title;
     var modalWindowElement = WaitTillFound(() => Finder.FindWindow(title, 0), message);
     return Create(modalWindowElement, option, windowSession);
 }
Esempio n. 11
0
 public InternetExplorerWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession)
     : base(automationElement, windowFactory, option, windowSession)
 {
 }
Esempio n. 12
0
 public DummyWindow(AutomationElement automationElement, InitializeOption initializeOption, WindowSession windowSession)
     : base(automationElement, initializeOption, windowSession) {}
Esempio n. 13
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);
 }
Esempio n. 14
0
 /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
 public virtual Window CreateWindow(SearchCriteria searchCriteria, Process process, InitializeOption option, WindowSession windowSession)
 {
     var message = string.Format("Couldn't find window with SearchCriteria {0} in process {1}{2}", searchCriteria, process.Id, Constants.BusyMessage);
     var element = WaitTillFound(() => Finder.FindWindow(searchCriteria, process.Id), message);
     return Create(element, option, windowSession);
 }
Esempio n. 15
0
 /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
 public virtual Window CreateWindow(string title, Process process, InitializeOption option, WindowSession windowSession)
 {
     var message = string.Format("Couldn't find window with title {0} in process {1}{2}", title, process.Id, ", after waiting for 30 seconds");
     var element = WaitTillFound(() => Finder.FindWindow(title, process.Id), message);
     return Create(element, option, windowSession);
 }
Esempio n. 16
0
 /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
 public virtual Window FindWindow(Process process, Predicate<string> match, InitializeOption initializeOption, WindowSession windowSession)
 {
     string message = string.Format("Could not find window matching condition. ProcessName: {0}, ProcessId: {1}, MatchingConditionMethod: {2}, MatchingConditionTarget: {3}", process.ProcessName, process.Id, match.Method, match.Target);
     var foundElement = WaitTillFound(() => FindWindowElement(process, match), message);
     return Create(foundElement, initializeOption, windowSession);
 }
Esempio n. 17
0
 public FirefoxWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession)
     : base(automationElement, windowFactory, option, windowSession)
 {
 }
Esempio n. 18
0
 private Desktop(AutomationElement automationElement, IActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession)
     : base(automationElement, actionListener, initializeOption, windowSession)
 {
     finder = new AutomationElementFinder(automationElement);
 }
Esempio n. 19
0
 public WPFWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption initializeOption,
     WindowSession windowSession)
     : base(automationElement, initializeOption, windowSession)
 {
     this.windowFactory = windowFactory;
 }