Exemplo n.º 1
0
        private void SwitchToFrame_(IWebElement frameElement,
                                    ISeleniumFrameCheckTarget frameTarget, Configuration config, List <FrameState> frameStates)
        {
            ITargetLocator switchTo = driver_.SwitchTo();

            switchTo.Frame(frameElement);
            IWebElement rootElement = SeleniumEyes.GetScrollRootElementFromSREContainer(frameTarget, driver_);
            Frame       frame       = driver_.GetFrameChain().Peek();

            frame.ScrollRootElement = rootElement;
            SaveCurrentFrameState_(frameStates, driver_, rootElement);
            TryHideScrollbarsInFrame(config, driver_, rootElement);
            frame.ScrollRootElementInnerBounds = EyesRemoteWebElement.GetClientBoundsWithoutBorders(rootElement, driver_, logger_);
        }
Exemplo n.º 2
0
        private void MaximizeTargetFrameInCurrentFrame_(IWebElement frameElement, IWebElement userDefinedSRE)
        {
            IWebElement currentFrameSRE = EyesSeleniumUtils.GetCurrentFrameScrollRootElement(driver_, userDefinedSRE);

            IPositionProvider positionProvider = SeleniumEyes.GetPositionProviderForScrollRootElement_(logger_, driver_,
                                                                                                       stitchMode_, userAgent_, currentFrameSRE);

            Rectangle frameRect = EyesRemoteWebElement.GetClientBoundsWithoutBorders(frameElement, driver_, logger_);

            if (stitchMode_ == StitchModes.Scroll)
            {
                Point pageScrollPosition = positionProvider.GetCurrentPosition();
                frameRect.Offset(pageScrollPosition);
            }
            positionProvider.SetPosition(frameRect.Location);
        }