internal void HideCaret()
 {
     if (configuration_.HideCaret)
     {
         frameChain_ = driver_.GetFrameChain().Clone();
         logger_.Verbose("Hiding caret. driver_.FrameChain.Count: {0}", frameChain_.Count);
         activeElement_ = driver_.ExecuteScript(HIDE_CARET);
     }
 }
예제 #2
0
        public string IdForDictionary => Id + "_" + eyesDriver_.RemoteWebDriver.SessionId; // Safari browser uses simple element ids so I chain Selenium session id

        #endregion

        #region Methods

        public Point ScrollTo(Point location)
        {
            if (eyesDriver_.ExecuteScript(string.Format(JS_SCROLL_TO_FORMATTED_STR, location.X, location.Y) + JS_GET_SCROLL_POSITION, this) is string scrollPositionStr)
            {
                string[] data = scrollPositionStr.Split(',');
                return(new Point(
                           (int)Math.Round(Convert.ToSingle(data[0], NumberFormatInfo.InvariantInfo)),
                           (int)Math.Round(Convert.ToSingle(data[1], NumberFormatInfo.InvariantInfo))));
            }
            return(Point.Empty);
        }
        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_);
        }