private bool FrameContentsMatch(IWebElement e,
                                        string locator,
                                        Options options)
        {
            var currentHandle = _selenium.CurrentWindowHandle;

            try
            {
                var frame = _seleniumWindowManager.SwitchToFrame(e);
                return
                    (frame.Title == locator ||
                     frame.FindElements(By.XPath($".//h1[{_xPath.IsText(locator, options)}]"))
                     .Any());
            }
            finally
            {
                _selenium.SwitchTo()
                .Window(currentHandle);

                // Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1305822
                if (_selenium is FirefoxDriver)
                {
                    _selenium.SwitchTo()
                    .DefaultContent();
                }
            }
        }
Exemple #2
0
        private bool FrameContentsMatch(IWebElement e, string locator, Options options)
        {
            var currentHandle = selenium.CurrentWindowHandle;

            try
            {
                var frame = seleniumWindowManager.SwitchToFrame(e);
                return
                    (frame.Title == locator ||
                     frame.FindElements(By.XPath(".//h1[" + xPath.IsText(locator, options) + "]")).Any());
            }
            finally
            {
                selenium.SwitchTo().Window(currentHandle);
            }
        }