public class WebConnectionHtmlUnitDriver
extends org.openqa.selenium.htmlunit.HtmlUnitDriver
Allows configuring the WebConnection for an HtmlUnitDriver instance. This is useful because it allows a MockMvcWebConnection to be injected.
MockMvcHtmlUnitDriverBuilder
org.openqa.selenium.htmlunit.HtmlUnitDriver.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollection
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
Constructor and Description |
---|
WebConnectionHtmlUnitDriver() |
WebConnectionHtmlUnitDriver(boolean enableJavascript) |
WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion version) |
WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) |
Modifier and Type | Method and Description |
---|---|
protected com.gargoylesoftware.htmlunit.WebClient |
configureWebClient(com.gargoylesoftware.htmlunit.WebClient client)
Subclasses can override this method to customise the WebClient that the HtmlUnit
driver uses.
|
com.gargoylesoftware.htmlunit.WebConnection |
getWebConnection()
Allows accessing the current WebConnection
|
protected com.gargoylesoftware.htmlunit.WebClient |
modifyWebClient(com.gargoylesoftware.htmlunit.WebClient client)
Captures the WebClient that is used so that its WebConnection is accessible.
|
void |
setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
Sets the WebConnection to be used.
|
assertElementNotStale, close, executeAsyncScript, executeScript, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, get, 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, switchTo
public WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion version)
public WebConnectionHtmlUnitDriver()
public WebConnectionHtmlUnitDriver(boolean enableJavascript)
public WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities)
protected final com.gargoylesoftware.htmlunit.WebClient modifyWebClient(com.gargoylesoftware.htmlunit.WebClient client)
modifyWebClient
in class org.openqa.selenium.htmlunit.HtmlUnitDriver
client
- The client to modifyprotected com.gargoylesoftware.htmlunit.WebClient configureWebClient(com.gargoylesoftware.htmlunit.WebClient client)
client
- The client to modifypublic com.gargoylesoftware.htmlunit.WebConnection getWebConnection()
public void setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
webConnection
- the WebConnection to use. Cannot be null.