public void Restore()
        {
            EyesWebDriverTargetLocator switchTo = (EyesWebDriverTargetLocator)driver_.SwitchTo();

            switchTo.Frames(frameChain_);

            cssPositionProvider_.RestoreState(cssMemento_);
            scrollPositionProvider_.RestoreState(scrollMemento_);
            driver_.ExecuteScript($"arguments[0].style.overflow='{overflow_}'", scrolledElement_);
        }
Exemplo n.º 2
0
        private void PrepareParentFrames_()
        {
            if (originalFrameChain_.Count == 0)
            {
                return;
            }

            EyesWebDriverTargetLocator switchTo = (EyesWebDriverTargetLocator)driver_.SwitchTo();
            FrameChain fc = originalFrameChain_.Clone();

            while (fc.Count > 0)
            {
                switchTo.ParentFrame();
                Frame       currentFrame = fc.Pop();
                IWebElement rootElement  = EyesSeleniumUtils.GetCurrentFrameScrollRootElement(driver_, null);
                SaveCurrentFrameState_(frameStates_, driver_, rootElement);
                MaximizeTargetFrameInCurrentFrame_(currentFrame.Reference, rootElement);
            }
            frameStates_.Reverse();
            switchTo.Frames(originalFrameChain_);
        }