OpenQA.Selenium.WindowSwitchingTest.ShouldSwitchFocusToANewWindowWhenItIsOpenedAndNotStopFutureOperations C# (CSharp) Méthode

ShouldSwitchFocusToANewWindowWhenItIsOpenedAndNotStopFutureOperations() private méthode

        public void ShouldSwitchFocusToANewWindowWhenItIsOpenedAndNotStopFutureOperations()
        {
            driver.Url = xhtmlTestPage;
            String current = driver.GetWindowHandle();

            driver.FindElement(By.LinkText("Open new window")).Click();
            Assert.AreEqual("XHTML Test Page", driver.Title);

            //TODO (jimevan): this is an ugly sleep. Remove when implicit waiting is implemented.
            SleepBecauseWindowsTakeTimeToOpen();

            driver.SwitchTo().Window("result");
            Assert.AreEqual("We Arrive Here", driver.Title);

            driver.Url = iframesPage;
            string handle = driver.GetWindowHandle();
            driver.FindElement(By.Id("iframe_page_heading"));
            driver.SwitchTo().Frame("iframe1");
            Assert.AreEqual(driver.GetWindowHandle(), handle);

            driver.SwitchTo().Window(current);
            //Assert.AreEqual("XHTML Test Page", driver.Title);
        }