Exemplo n.º 1
0
        public void ReturnToOriginalPosition(IWebDriver driver)
        {
            IWebElement       scrollRootElement = GetScrollRootElement(driver);
            IPositionProvider positionProvider  = new ScrollPositionProvider(logger_, jsExecutor_, scrollRootElement);

            positionProvider.RestoreState(positionMemento_);
        }
Exemplo n.º 2
0
        public IWebDriver FramesDoScroll(FrameChain frameChain)
        {
            logger_.Log(TraceLevel.Debug, Stage.General, StageType.Called);
            ITargetLocator targetLocator = driver_.SwitchTo();

            targetLocator.DefaultContent();
            IPositionProvider scrollProvider = new ScrollPositionProvider(logger_, jsExecutor_, driver_.Eyes.GetCurrentFrameScrollRootElement());

            defaultContentPositionMemento_ = scrollProvider.GetState();
            foreach (Frame frame in frameChain)
            {
                Point frameLocation = frame.Location;
                scrollProvider.SetPosition(frameLocation);
                targetLocator.Frame(frame.Reference);
                Frame newFrame = driver_.GetFrameChain().Peek();
                newFrame.ScrollRootElement            = frame.ScrollRootElement;
                newFrame.ScrollRootElementInnerBounds = frame.ScrollRootElementInnerBounds;
            }

            return(driver_);
        }