public SilverlightDocument(AutomationElement automationElement, BrowserWindow actionListener, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, actionListener, initializeOption, windowSession) { ieWindow = actionListener; }
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; }
/// <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); }
/// <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 virtual Window Create(AutomationElement automationElement, InitializeOption initializeOption, WindowSession session) { return new FirefoxWindow(automationElement, WindowFactory.Desktop, initializeOption, session); }
protected Window(AutomationElement automationElement, ActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, actionListener, initializeOption, windowSession) { InitializeWindow(); minOpenTime = Task.Factory.StartNew(() => Thread.Sleep(500)); }
protected Window(AutomationElement automationElement, InitializeOption initializeOption, WindowSession windowSession) : this(automationElement, new NullActionListener(), initializeOption, windowSession) { }
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); }
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); }
public InternetExplorerWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession) : base(automationElement, windowFactory, option, windowSession) { }
public DummyWindow(AutomationElement automationElement, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, initializeOption, windowSession) {}
/// <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); }
/// <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); }
/// <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); }
/// <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); }
public FirefoxWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession) : base(automationElement, windowFactory, option, windowSession) { }
private Desktop(AutomationElement automationElement, IActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, actionListener, initializeOption, windowSession) { finder = new AutomationElementFinder(automationElement); }
public WPFWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, initializeOption, windowSession) { this.windowFactory = windowFactory; }