Ejemplo n.º 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());
            }
        }
Ejemplo n.º 2
0
        internal void UpdateBrowserWindowsList(BrowserWindow[] currentWindows, string currentWindowHandle)
        {
            ddlWindows.DoInvokeAction(() =>
            {
                ddlWindows.Items.Clear();
                ddlWindows.Items.AddRange(currentWindows);

                ddlWindows.SelectedItem = currentWindows.First(win => (win.WindowHandle == currentWindowHandle));
            });
        }
Ejemplo n.º 3
0
 public static void GotoWindow(BrowserWindow window)
 {
     lock (lockObject)
     {
         GetDriver().SwitchTo().Window(window.WindowHandle);
     }
 }
Ejemplo n.º 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();
     }
 }