コード例 #1
0
        private string GetDom_(string[] testIds)
        {
            FrameChain originalFC = webDriver_.GetFrameChain().Clone();

            logger_.Verbose("saving current frame chain - size: {0} ; frame: {1}", originalFC.Count, originalFC.Peek());
            string dom = "";

            try
            {
                dom = GetFrameDom_(testIds);
            }
            catch (Exception e)
            {
                CommonUtils.LogExceptionStackTrace(logger_, Stage.Check, StageType.DomScript, e, testIds);
            }

            logger_.Verbose("switching back to original frame");
            ((EyesWebDriverTargetLocator)webDriver_.SwitchTo()).Frames(originalFC);
            FrameChain currentFC = webDriver_.GetFrameChain();

            logger_.Verbose("switched to frame chain - size: {0} ; frame: {1}", currentFC.Count, currentFC.Peek());

            WaitForCssDownloadToFinish_(testIds);
            logger_.Log(TraceLevel.Info, testIds, Stage.Check, StageType.DomScript,
                        new { message = "finished waiting for CSS files to download" });
            string inlaidString = StringUtils.EfficientStringReplace(cssStartToken_, cssEndToken_, dom, cssData_);

            logger_.Log(TraceLevel.Info, testIds, Stage.Check, StageType.DomScript, new { inlaidStringLength = inlaidString.Length });
            return(inlaidString);
        }
コード例 #2
0
        private string GetDom_()
        {
            FrameChain originalFC = null;

            originalFC = webDriver_.GetFrameChain().Clone();
            logger_.Verbose("saving current frame chain - size: {0} ; frame: {1}", originalFC.Count, originalFC.Peek());
            string dom = "";

            try
            {
                dom = GetFrameDom_();
            }
            catch (Exception e)
            {
                logger_.Log("Error: " + e);
            }

            logger_.Verbose("switching back to original frame");
            ((EyesWebDriverTargetLocator)webDriver_.SwitchTo()).Frames(originalFC);
            FrameChain currentFC = webDriver_.GetFrameChain();

            logger_.Verbose("switched to frame chain - size: {0} ; frame: {1}", currentFC.Count, currentFC.Peek());

            WaitForCssDownloadToFinish_();
            logger_.Verbose("finished waiting for CSS files to download");
            string inlaidString = StringUtils.EfficientStringReplace(cssStartToken_, cssEndToken_, dom, cssData_);

            logger_.Verbose("inlaid string");
            return(inlaidString);
        }