Class HtmlUnitUtils


  • public class HtmlUnitUtils
    extends java.lang.Object
    Utility class for easier use of HtmlUnit.
    Since:
    6.0
    Author:
    Javier Paniza
    • Constructor Summary

      Constructors 
      Constructor Description
      HtmlUnitUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertElementExists​(org.htmlunit.html.HtmlPage page, java.lang.String id)  
      static void assertElementNotExist​(org.htmlunit.html.HtmlPage page, java.lang.String id)  
      static void assertPageURI​(org.htmlunit.html.HtmlPage page, java.lang.String value)  
      static org.htmlunit.html.HtmlElement getAnchor​(org.htmlunit.html.HtmlPage page, java.lang.String url)  
      static java.util.List<org.htmlunit.html.HtmlElement> getAnchors​(org.htmlunit.html.HtmlPage page, java.lang.String url)  
      static org.htmlunit.BrowserVersion getAndroidBrowser()  
      static org.htmlunit.BrowserVersion getBrowser​(java.lang.String userAgent)  
      static org.htmlunit.BrowserVersion getDefaultBrowser()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HtmlUnitUtils

        public HtmlUnitUtils()
    • Method Detail

      • getAnchor

        public static org.htmlunit.html.HtmlElement getAnchor​(org.htmlunit.html.HtmlPage page,
                                                              java.lang.String url)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAnchors

        public static java.util.List<org.htmlunit.html.HtmlElement> getAnchors​(org.htmlunit.html.HtmlPage page,
                                                                               java.lang.String url)
                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • assertElementExists

        public static void assertElementExists​(org.htmlunit.html.HtmlPage page,
                                               java.lang.String id)
      • assertElementNotExist

        public static void assertElementNotExist​(org.htmlunit.html.HtmlPage page,
                                                 java.lang.String id)
      • assertPageURI

        public static void assertPageURI​(org.htmlunit.html.HtmlPage page,
                                         java.lang.String value)
      • getAndroidBrowser

        public static org.htmlunit.BrowserVersion getAndroidBrowser()
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBrowser

        public static org.htmlunit.BrowserVersion getBrowser​(java.lang.String userAgent)
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDefaultBrowser

        public static org.htmlunit.BrowserVersion getDefaultBrowser()
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
        Since:
        7.1