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.
MockMvcHtmlUnitDriverBuilderorg.openqa.selenium.htmlunit.HtmlUnitDriver.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollectionorg.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| Constructor and Description |
|---|
WebConnectionHtmlUnitDriver() |
WebConnectionHtmlUnitDriver(boolean enableJavascript) |
WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion) |
WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) |
| Modifier and Type | Method and Description |
|---|---|
com.gargoylesoftware.htmlunit.WebConnection |
getWebConnection()
Access the current
WebConnection for the WebClient. |
protected 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. |
protected com.gargoylesoftware.htmlunit.WebClient |
modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the supplied
WebClient. |
void |
setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
Set the
WebConnection to be used with the WebClient. |
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, getWebClient, getWindowHandle, getWindowHandles, implicitlyWaitFor, isJavascriptEnabled, lastPage, manage, navigate, newHtmlUnitWebElement, newWebClient, pickWindow, quit, setAutoProxy, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTopublic WebConnectionHtmlUnitDriver()
public WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
public WebConnectionHtmlUnitDriver(boolean enableJavascript)
public WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities)
protected final com.gargoylesoftware.htmlunit.WebClient modifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
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 in class org.openqa.selenium.htmlunit.HtmlUnitDriverwebClient - the client to modifyHtmlUnitDriver.modifyWebClient(WebClient),
modifyWebClientInternal(WebClient)protected com.gargoylesoftware.htmlunit.WebClient modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)
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 modifypublic void setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
WebConnection to be used with the WebClient.webConnection - the WebConnection to use (never null)public com.gargoylesoftware.htmlunit.WebConnection getWebConnection()
WebConnection for the WebClient.WebConnection