Beispiel #1
0
        /// <summary>
        /// Returns the rendered HTML code of the current page
        ///
        /// This is done using <code>ie.element("HTML").outherHTML()</code>
        /// because Watin's HTML value (via <code>ie.IE.HTML</code>) was actually the
        /// html of the BODY element
        /// </summary>
        /// <param name="ie"></param>
        /// <returns></returns>
        public static string        html(this WatiN_IE ie)
        {
            return(ie.element("HTML").outerHtml());

            //return ie.documentElement().html();

            /*
             *          try
             *  {
             *          if (ie.IE.InternetExplorer.notNull() && ie.IE.InternetExplorer is IWebBrowser2)
             *          {
             *                  var webBrowser = (IWebBrowser2)ie.IE.InternetExplorer;
             *                  if (webBrowser.Document.notNull() && webBrowser.Document is HTMLDocumentClass)
             *                  {
             *                          var htmlDocument = (HTMLDocumentClass)webBrowser.Document;
             *                          if (htmlDocument.documentElement.notNull())
             *                                  return htmlDocument.documentElement.outerHTML;
             *                  }
             *          }
             *  }
             *  catch(Exception ex)
             *  {
             *          ex.log("in WatiN_IE html()");
             *  }
             *  return "";*/
        }
Beispiel #2
0
 public static Element head(this WatiN_IE watinIe)
 {
     return(watinIe.element("head"));
 }
Beispiel #3
0
 public static Element body(this WatiN_IE watinIe)
 {
     return(watinIe.element("body"));
 }