public TestIEPage(TestInternetExplorer browser, InternetExplorer ie) { if (browser == null || ie == null) { throw new CannotGetTestPageException("Browser can not be null."); } try { this._browser = browser; this._internalIE = ie; this._rootDocument = new TestIEDocument(ie.Document as IHTMLDocument2); } catch (TestException) { throw; } catch (Exception ex) { throw new CannotGetTestPageException(ex.ToString()); } }
protected virtual TestIEDocument[] GetFrames(TestIEDocument root) { if (root != null) { List<TestIEDocument> allDocs = new List<TestIEDocument>(); allDocs.Add(root); TestIEDocument[] frames = root.GetFrames() as TestIEDocument[]; if (frames != null && frames.Length > 0) { foreach (TestIEDocument frame in frames) { try { TestIEDocument[] subFrames = GetFrames(frame); allDocs.AddRange(subFrames); } catch { } } } return allDocs.ToArray(); } return null; }