Exemple #1
0
        public static BrowserWindow[] GetBrowserWindows()
        {
            lock (lockObject)
            {
                var windowHandles = GetDriver().WindowHandles;
                var result        = new List <BrowserWindow>();

                string currentHandle = GetDriver().CurrentWindowHandle;

                foreach (var winHandle in windowHandles)
                {
                    var item = new BrowserWindow();
                    item.WindowHandle = winHandle;
                    GetDriver().SwitchTo().Window(winHandle);
                    item.Title = GetDriver().Title;
                    result.Add(item);
                }

                GetDriver().SwitchTo().Window(currentHandle);

                return(result.ToArray());
            }
        }
        internal void UpdateBrowserWindowsList(BrowserWindow[] currentWindows, string currentWindowHandle)
        {
            ddlWindows.DoInvokeAction(() =>
            {
                ddlWindows.Items.Clear();
                ddlWindows.Items.AddRange(currentWindows);

                ddlWindows.SelectedItem = currentWindows.First(win => (win.WindowHandle == currentWindowHandle));
            });
        }
Exemple #3
0
 public static void GotoWindow(BrowserWindow window)
 {
     lock (lockObject)
     {
         GetDriver().SwitchTo().Window(window.WindowHandle);
     }
 }
Exemple #4
0
        public static BrowserWindow[] GetBrowserWindows()
        {
            lock (lockObject)
            {
                var windowHandles = GetDriver().WindowHandles;
                var result = new List<BrowserWindow>();

                string currentHandle = GetDriver().CurrentWindowHandle;

                foreach (var winHandle in windowHandles)
                {
                    var item = new BrowserWindow();
                    item.WindowHandle = winHandle;
                    GetDriver().SwitchTo().Window(winHandle);
                    item.Title = GetDriver().Title;
                    result.Add(item);
                }

                GetDriver().SwitchTo().Window(currentHandle);

                return result.ToArray();
            }
        }
 internal void SwitchToWindow(BrowserWindow window)
 {
     PauseWebElementExplorerProcessing();
     view.DisableSwitchToControls();
     try
     {
         SwdBrowser.GotoWindow(window);
         MyLog.Write("WINDOW: Switched to window/popup with WinID= "
                     + window.WindowHandle + "; and Title:" + window.Title);
         RefreshFramesList();
     }
     finally
     {
         ResumeWebElementExplorerProcessing();
         view.EnableSwitchToControls();
     }
 }