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.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.
- 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.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollectionNested classes/interfaces inherited from interface org.openqa.selenium.WebDriverorg.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
- 
Field SummaryFields inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriverBROWSER_LANGUAGE_CAPABILITY, DOWNLOAD_IMAGES_CAPABILITY, INVALIDSELECTIONERROR, INVALIDXPATHERROR, JAVASCRIPT_ENABLED
- 
Constructor SummaryConstructorsConstructorDescriptionWebConnectionHtmlUnitDriver(boolean enableJavascript) WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion) WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) 
- 
Method SummaryModifier and TypeMethodDescriptioncom.gargoylesoftware.htmlunit.WebClientReturn the currentWebClientin a public fashion.com.gargoylesoftware.htmlunit.WebConnectionAccess the currentWebConnectionfor theWebClient.protected final com.gargoylesoftware.htmlunit.WebClientmodifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient) Modify the suppliedWebClientand retain a reference to it so that itsWebConnectionis accessible for later use.protected com.gargoylesoftware.htmlunit.WebClientmodifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient) Modify the suppliedWebClient.voidsetWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection) Set theWebConnectionto be used with theWebClient.Methods inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriverassertElementNotStale, 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, getElementById, getKeyboard, getMouse, getPageSource, getTitle, getWindowHandle, getWindowHandles, implicitlyWaitFor, isAcceptSslCertificates, isDownloadImages, isJavascriptEnabled, lastPage, manage, navigate, newWebClient, pickWindow, quit, setAcceptSslCertificates, setAutoProxy, setDownloadImages, setExecutor, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTo, toWebElement
- 
Constructor Details- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver()
- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion) 
- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver(boolean enableJavascript) 
- 
WebConnectionHtmlUnitDriverpublic WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) 
 
- 
- 
Method Details- 
modifyWebClientprotected final com.gargoylesoftware.htmlunit.WebClient modifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient) Modify the suppliedWebClientand retain a reference to it so that itsWebConnectionis accessible for later use.Delegates to HtmlUnitDriver.modifyWebClient(com.gargoylesoftware.htmlunit.WebClient)for default behavior and tomodifyWebClientInternal(com.gargoylesoftware.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 com.gargoylesoftware.htmlunit.WebClient modifyWebClientInternal(com.gargoylesoftware.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 com.gargoylesoftware.htmlunit.WebClient getWebClient()Return the currentWebClientin a public fashion.- Overrides:
- getWebClientin class- org.openqa.selenium.htmlunit.HtmlUnitDriver
- Since:
- 4.3
 
- 
setWebConnectionpublic void setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection) Set theWebConnectionto be used with theWebClient.- Parameters:
- webConnection- the- WebConnectionto use
 
- 
getWebConnectionpublic com.gargoylesoftware.htmlunit.WebConnection getWebConnection()Access the currentWebConnectionfor theWebClient.- Returns:
- the current WebConnection
 
 
-