public void RefreshFramesList() { Exception outException; bool isOk = false; isOk = UIActions.PerformSlowOperation( "Operation: Refresh All Frames List", () => { BrowserPageFrame rootFrame = SwdBrowser.GetPageFramesTree(); BrowserPageFrame[] currentPageFrames = rootFrame.ToList().ToArray(); SwdBrowser.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; } } }
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 = SwdBrowser.GetPageFramesTree(); List <BrowserPageFrame> allFrames = rootFrame.ToList(); string[] actualTitles = allFrames.Select(i => i.ToString()).ToArray(); actualTitles.Should().Equal(expectedTitles); SwdBrowser.CloseDriver(); }