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

CanCallGetWindowHandlesAfterClosingAWindow() private méthode

private CanCallGetWindowHandlesAfterClosingAWindow ( ) : void
Résultat void
        public void CanCallGetWindowHandlesAfterClosingAWindow()
        {
            driver.Url = xhtmlTestPage;

            String currentHandle = driver.GetWindowHandle();

            driver.FindElement(By.Name("windowThree")).Click();

            driver.SwitchTo().Window("result");

            try
            {
                driver.FindElement(By.Id("close")).Click();
                driver.GetWindowHandles();
                // If we make it this far, we're all good.
            }
            finally
            {
                driver.SwitchTo().Window(currentHandle);
            }
        }