Example #1
0
        public void Get_Frames_Tree()
        {
            string[] expectedTitles = new string[]
            {
                "DefaultContent",
                "firstFrame",
                "secondFrame",
                "secondFrame.idIframeInsideSecondFrame",
                "thirdFrame",
                "thirdFrame.0"
            };


            Helper.RunDefaultBrowser();
            Helper.LoadTestFile("page_with_frames.html");


            BrowserPageFrame        rootFrame = WebSpyBrowser.GetPageFramesTree();
            List <BrowserPageFrame> allFrames = rootFrame.ToList();

            string[] actualTitles = allFrames.Select(i => i.ToString()).ToArray();

            actualTitles.Should().Equal(expectedTitles);

            WebSpyBrowser.CloseDriver();
        }
Example #2
0
        public void RefreshFramesList()
        {
            Exception outException;
            bool      isOk = false;

            isOk = UIActions.PerformSlowOperation(
                "Operation: Refresh All Frames List",
                () =>
            {
                BrowserPageFrame rootFrame           = WebSpyBrowser.GetPageFramesTree();
                BrowserPageFrame[] currentPageFrames = rootFrame.ToList().ToArray();
                WebSpyBrowser.SwitchToDefaultContent();
                view.UpdatePageFramesList(currentPageFrames);
            },
                out outException,
                null,
                TimeSpan.FromMinutes(1)
                );

            if (!isOk)
            {
                MyLog.Error("Failed to refresh All Frames List");
                MyLog.Exception(outException);
                if (outException != null)
                {
                    throw outException;
                }
            }
        }