Class WebConnectionHtmlUnitDriver
java.lang.Object
org.openqa.selenium.htmlunit.HtmlUnitDriver
org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
- All Implemented Interfaces:
- org.openqa.selenium.HasCapabilities,- org.openqa.selenium.interactions.Interactive,- 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.
- Since:
- 4.2
- Author:
- Rob Winch, Sam Brannen, Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriverorg.openqa.selenium.htmlunit.HtmlUnitDriver.ElementsMap, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollectionNested classes/interfaces inherited from interface org.openqa.selenium.WebDriverorg.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
- 
Field SummaryFields inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriverBROWSER_LANGUAGE_CAPABILITY, DOWNLOAD_IMAGES_CAPABILITY, JAVASCRIPT_ENABLED
- 
Constructor SummaryConstructorsConstructorDescriptionWebConnectionHtmlUnitDriver(boolean enableJavascript) WebConnectionHtmlUnitDriver(org.htmlunit.BrowserVersion browserVersion) WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.htmlunit.WebClientReturn the currentWebClientin a public fashion.org.htmlunit.WebConnectionAccess the currentWebConnectionfor theWebClient.protected final org.htmlunit.WebClientmodifyWebClient(org.htmlunit.WebClient webClient) Modify the suppliedWebClientand retain a reference to it so that itsWebConnectionis accessible for later use.protected org.htmlunit.WebClientmodifyWebClientInternal(org.htmlunit.WebClient webClient) Modify the suppliedWebClient.voidsetWebConnection(org.htmlunit.WebConnection webConnection) Set theWebConnectionto be used with theWebClient.Methods inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriverassertElementNotStale, click, close, doubleClick, executeAsyncScript, executeScript, findElement, findElement, findElements, findElements, get, get, getAlert, getBrowserVersion, getCapabilities, getCurrentUrl, getCurrentWindow, getElementsMap, getKeyboard, getMouse, getPageSource, getTitle, getWindowHandle, getWindowHandles, implicitlyWaitFor, isAcceptInsecureCerts, isDownloadImages, isJavascriptEnabled, manage, mouseDown, mouseMove, mouseUp, navigate, newWebClient, openNewWindow, perform, quit, resetInputState, runAsync, sendKeys, setAcceptInsecureCerts, setAutoProxy, setCurrentWindow, setDownloadImages, setExecutor, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, submit, switchTo, switchToDefaultContentOfWindow, toWebElementMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.JavascriptExecutorexecuteScript, getPinnedScripts, pin, unpin
- 
Constructor Details- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver()
- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver(org.htmlunit.BrowserVersion browserVersion) 
- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver(boolean enableJavascript) 
- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) 
 
- 
- 
Method Details- 
modifyWebClientprotected final org.htmlunit.WebClient modifyWebClient(org.htmlunit.WebClient webClient) Modify the suppliedWebClientand retain a reference to it so that itsWebConnectionis accessible for later use.Delegates to HtmlUnitDriver.modifyWebClient(org.htmlunit.WebClient)for default behavior and tomodifyWebClientInternal(org.htmlunit.WebClient)for further customization.- Overrides:
- modifyWebClientin class- org.openqa.selenium.htmlunit.HtmlUnitDriver
- Parameters:
- webClient- the client to modify
- Returns:
- the modified client
- See Also:
- 
- HtmlUnitDriver.modifyWebClient(WebClient)
- modifyWebClientInternal(WebClient)
 
 
- 
modifyWebClientInternalprotected org.htmlunit.WebClient modifyWebClientInternal(org.htmlunit.WebClient webClient) Modify the suppliedWebClient.The default implementation simply returns the supplied client unmodified. Subclasses can override this method to customize the WebClientthat theHtmlUnitDriveruses.- Parameters:
- webClient- the client to modify
- Returns:
- the modified client
 
- 
getWebClientpublic org.htmlunit.WebClient getWebClient()Return the currentWebClientin a public fashion.- Overrides:
- getWebClientin class- org.openqa.selenium.htmlunit.HtmlUnitDriver
- Since:
- 4.3
 
- 
setWebConnectionpublic void setWebConnection(org.htmlunit.WebConnection webConnection) Set theWebConnectionto be used with theWebClient.- Parameters:
- webConnection- the- WebConnectionto use
 
- 
getWebConnectionpublic org.htmlunit.WebConnection getWebConnection()Access the currentWebConnectionfor theWebClient.- Returns:
- the current WebConnection
 
 
-