类 WebConnectionHtmlUnitDriver

  • 所有已实现的接口:
    org.openqa.selenium.HasCapabilities, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.internal.FindsByClassName, org.openqa.selenium.internal.FindsByCssSelector, org.openqa.selenium.internal.FindsById, org.openqa.selenium.internal.FindsByLinkText, org.openqa.selenium.internal.FindsByName, org.openqa.selenium.internal.FindsByTagName, org.openqa.selenium.internal.FindsByXPath, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.WebDriver

    public class WebConnectionHtmlUnitDriver
    extends org.openqa.selenium.htmlunit.HtmlUnitDriver
    WebConnectionHtmlUnitDriver enables configuration of the WebConnection for an HtmlUnitDriver instance.

    This is useful because it allows a MockMvcWebConnection to be injected.

    从以下版本开始:
    4.2
    作者:
    Rob Winch, Sam Brannen
    另请参阅:
    MockMvcHtmlUnitDriverBuilder
    • 嵌套类概要

      • 从类继承的嵌套类/接口 org.openqa.selenium.htmlunit.HtmlUnitDriver

        org.openqa.selenium.htmlunit.HtmlUnitDriver.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollection
      • 从接口继承的嵌套类/接口 org.openqa.selenium.WebDriver

        org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
    • 字段概要

      • 从类继承的字段 org.openqa.selenium.htmlunit.HtmlUnitDriver

        BROWSER_LANGUAGE_CAPABILITY, INVALIDSELECTIONERROR, INVALIDXPATHERROR
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      com.gargoylesoftware.htmlunit.WebClientgetWebClient()
      Return the current WebClient.
      com.gargoylesoftware.htmlunit.WebConnectiongetWebConnection()
      Access the current WebConnection for the WebClient.
      protected com.gargoylesoftware.htmlunit.WebClientmodifyWebClient​(com.gargoylesoftware.htmlunit.WebClient webClient)
      Modify the supplied WebClient and retain a reference to it so that its WebConnection is accessible for later use.
      protected com.gargoylesoftware.htmlunit.WebClientmodifyWebClientInternal​(com.gargoylesoftware.htmlunit.WebClient webClient)
      Modify the supplied WebClient.
      voidsetWebConnection​(com.gargoylesoftware.htmlunit.WebConnection webConnection)
      Set the WebConnection to be used with the WebClient.
      • 从类继承的方法 org.openqa.selenium.htmlunit.HtmlUnitDriver

        assertElementNotStale, close, executeAsyncScript, executeScript, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, get, getBrowserVersion, getCapabilities, getCurrentUrl, getCurrentWindow, getKeyboard, getMouse, getPageSource, getTitle, getWindowHandle, getWindowHandles, implicitlyWaitFor, isJavascriptEnabled, lastPage, manage, navigate, newHtmlUnitWebElement, newWebClient, pickWindow, quit, setAutoProxy, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTo
    • 方法详细资料

      • modifyWebClient

        protected final com.gargoylesoftware.htmlunit.WebClient modifyWebClient​(com.gargoylesoftware.htmlunit.WebClient webClient)
        Modify the supplied WebClient and retain a reference to it so that its WebConnection is accessible for later use.

        Delegates to HtmlUnitDriver.modifyWebClient(com.gargoylesoftware.htmlunit.WebClient) for default behavior and to modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient) for further customization.

        覆盖:
        modifyWebClient 在类中 org.openqa.selenium.htmlunit.HtmlUnitDriver
        参数:
        webClient - the client to modify
        返回:
        the modified client
        另请参阅:
        HtmlUnitDriver.modifyWebClient(WebClient), modifyWebClientInternal(WebClient)
      • modifyWebClientInternal

        protected com.gargoylesoftware.htmlunit.WebClient modifyWebClientInternal​(com.gargoylesoftware.htmlunit.WebClient webClient)
        Modify the supplied WebClient.

        The default implementation simply returns the supplied client unmodified.

        Subclasses can override this method to customize the WebClient that the HtmlUnitDriver uses.

        参数:
        webClient - the client to modify
        返回:
        the modified client
      • getWebClient

        public com.gargoylesoftware.htmlunit.WebClient getWebClient()
        Return the current WebClient.
        覆盖:
        getWebClient 在类中 org.openqa.selenium.htmlunit.HtmlUnitDriver
        从以下版本开始:
        4.3
      • setWebConnection

        public void setWebConnection​(com.gargoylesoftware.htmlunit.WebConnection webConnection)
        Set the WebConnection to be used with the WebClient.
        参数:
        webConnection - the WebConnection to use
      • getWebConnection

        public com.gargoylesoftware.htmlunit.WebConnection getWebConnection()
        Access the current WebConnection for the WebClient.
        返回:
        the current WebConnection