示例#1
0
        internal int SwitchToTargetFrame_(ISeleniumCheckTarget checkTarget, Configuration config,
                                          List <FrameState> frameStates, IWebElement userDefinedSRE)
        {
            IList <FrameLocator> frameChain = checkTarget.GetFrameChain();

            foreach (FrameLocator frameLocator in frameChain)
            {
                IWebElement frameElement = EyesSeleniumUtils.FindFrameByFrameCheckTarget(frameLocator, driver_);
                MaximizeTargetFrameInCurrentFrame_(frameElement, userDefinedSRE);
                SwitchToFrame_(frameElement, frameLocator, config, frameStates);
            }
            return(frameChain.Count);
        }
示例#2
0
        internal void PreparePage(ISeleniumCheckTarget seleniumCheckTarget, Configuration config, IWebElement userDefinedSRE)
        {
            frameStates_        = new List <FrameState>();
            originalFrameChain_ = driver_.GetFrameChain().Clone();

            if (seleniumCheckTarget.GetTargetElement() != null ||
                seleniumCheckTarget.GetTargetSelector() != null ||
                seleniumCheckTarget.GetFrameChain().Count > 0)
            {
                PrepareParentFrames_();
            }

            SaveCurrentFrameState_(frameStates_, driver_, userDefinedSRE);
            TryHideScrollbarsInFrame(config, driver_, userDefinedSRE);

            int switchedToFrameCount = SwitchToTargetFrame_(seleniumCheckTarget, config, frameStates_, userDefinedSRE);

            logger_.Verbose(nameof(switchedToFrameCount) + ": {0}", switchedToFrameCount);
        }