internal void TryRestoreScrollbars()
 {
     if (configuration_.HideScrollbars)
     {
         ((EyesWebDriverTargetLocator)driver_.SwitchTo()).Frames(frameChain_);
         FrameChain fc = frameChain_.Clone();
         if (fc.Count > 0)
         {
             while (fc.Count > 0)
             {
                 Frame frame = fc.Pop();
                 frame.ReturnToOriginalOverflow(driver_);
                 EyesWebDriverTargetLocator.ParentFrame(logger_, driver_.RemoteWebDriver.SwitchTo(), fc);
             }
         }
         else
         {
             if (originalOverflow_ != null)
             {
                 logger_.Verbose("returning overflow of element to its original value: {0}", scrollRootElement_);
                 EyesSeleniumUtils.SetOverflow(originalOverflow_, driver_, scrollRootElement_);
             }
         }
         ((EyesWebDriverTargetLocator)driver_.SwitchTo()).Frames(frameChain_);
         logger_.Verbose("done restoring scrollbars.");
     }
     else
     {
         logger_.Verbose("no need to restore scrollbars.");
     }
 }
示例#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_);
        }